Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
projecttwo
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wangtao
projecttwo
Commits
bfbd5862
Commit
bfbd5862
authored
Jun 10, 2025
by
wangzhengwen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
6.10
parent
249bc729
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
46 additions
and
21 deletions
+46
-21
Course.php
app/api/controller/Course.php
+4
-2
Cert.php
app/api/controller/cert/Cert.php
+12
-0
Cert.php
app/api/controller/mine/Cert.php
+21
-8
CertValidate.php
app/api/validate/CertValidate.php
+1
-1
common.php
app/common.php
+4
-3
Course.php
app/model/Course.php
+4
-7
No files found.
app/api/controller/Course.php
View file @
bfbd5862
...
...
@@ -3,6 +3,7 @@
namespace
app\api\controller
;
use
app\api\middleware\Auth
;
use
app\api\service\TokenService
;
use
app\api\service\UtilService
;
use
app\model\CourseTeacher
;
use
app\Request
;
...
...
@@ -119,10 +120,11 @@ class Course extends BaseController
return
$vo
;
}
$data
=
$request
->
param
();
$token
=
$request
->
header
(
'token'
);
$userId
=
TokenService
::
verifyToken
(
$token
)[
'user_id'
]
??
0
;
$data
=
(
new
CourseModel
())
// ->with(['getTeacher','getSections'=>['getCourseClass'],'getCourseClass'])
->
getCouresDetail
(
$data
[
'course_id'
]);
->
getCourseDetail
(
$data
[
'course_id'
],
$userId
);
CourseModel
::
where
(
'id'
,
$request
->
param
(
'course_id'
))
->
inc
(
'click'
)
->
update
([]);
return
$this
->
returnMsg
(
'success'
,
1
,
$data
);
...
...
app/api/controller/cert/Cert.php
View file @
bfbd5862
...
...
@@ -2,6 +2,7 @@
namespace
app\api\controller\cert
;
use
app\api\service\TokenService
;
use
app\api\validate\CertValidate
;
use
app\BaseController
;
use
app\model\CertCategory
;
...
...
@@ -75,6 +76,17 @@ class Cert extends BaseController
$detail
=
CertModel
::
where
(
'id'
,
$data
[
'cert_id'
])
->
append
([
'starttimetxt'
,
'endtimetxt'
])
->
find
();
if
(
$detail
)
{
$token
=
$request
->
header
(
'token'
);
$userId
=
TokenService
::
verifyToken
(
$token
)[
'user_id'
]
??
0
;
$detail
[
'is_enroll'
]
=
CertOrder
::
where
([
'cert_id'
=>
$data
[
'cert_id'
],
'user_id'
=>
$userId
,
'is_del'
=>
0
])
->
where
(
'status'
,
'<>'
,
2
)
->
count
();
}
return
$this
->
returnMsg
(
'success'
,
1
,
$detail
);
...
...
app/api/controller/mine/Cert.php
View file @
bfbd5862
...
...
@@ -29,6 +29,8 @@ class Cert extends BaseController
}
$query
=
CertOrder
::
where
(
$where
)
// ->append(['otherFileList'])
// ->with(['headImg','idcardQ','idcardH'])
->
alias
(
'co'
)
->
join
(
'cert c'
,
'c.id = co.cert_id'
)
->
field
([
...
...
@@ -66,17 +68,28 @@ class Cert extends BaseController
$data
=
$request
->
param
();
$item
=
CertOrder
::
where
([
'id'
=>
$data
[
'cert_order_id'
],
'user_id'
=>
$request
->
userId
])
$item
=
CertOrder
::
where
([
'co.id'
=>
$data
[
'cert_order_id'
],
'co.user_id'
=>
$request
->
userId
])
->
alias
(
'co'
)
->
join
(
'cert c'
,
'c.id = co.cert_id'
)
->
field
([
'co.*'
,
'c.title'
,
'c.fzjg'
,
'c.id as cert_id'
,
'c.price'
,
'c.sn'
])
->
append
([
'otherFileList'
])
->
with
([
'cert'
,
'headImg'
,
'idcardQ'
,
'idcardH'
])
->
find
();
if
(
$item
)
{
$item
[
'otherFiles'
]
=
SystemUploadFile
::
whereIn
(
'fileid'
,
$item
->
other_file_id
)
->
where
(
'isdel'
,
0
)
->
field
(
'fileid,filename,filesize,fileurl,filetype'
)
->
select
();
}
//
if ($item)
//
{
//
$item['otherFiles'] = SystemUploadFile::whereIn('fileid',$item->other_file_id)
//
->where('isdel',0)
//
->field('fileid,filename,filesize,fileurl,filetype')
//
->select();
//
}
return
$this
->
returnMsg
(
'success'
,
1
,
$item
);
...
...
app/api/validate/CertValidate.php
View file @
bfbd5862
...
...
@@ -16,7 +16,7 @@ class CertValidate extends BaseValidate
'mobile'
=>
'require|mobile'
,
'email'
=>
'require|email'
,
'head_img_id'
=>
'require|number'
,
'other_file_id'
=>
'require
|number
'
,
'other_file_id'
=>
'require'
,
'pay_type'
=>
'require|number'
,
'cert_order_id'
=>
'require|number'
,
'pid'
=>
'require|number'
,
...
...
app/common.php
View file @
bfbd5862
...
...
@@ -35,15 +35,16 @@ use app\model\system\SystemUploadFile;
//获取图片地址
function
get_upload_file
(
$fileid
=
''
,
$datatype
=
''
)
{
$field
=
[
'fileid,filename,filesize,fileurl,filetype,storage,fileext'
];
if
(
$datatype
==
'list'
)
{
//多附件读取列表
$map
[]
=
[
'fileid'
,
'in'
,
$fileid
];
return
SystemUploadFile
::
where
(
$map
)
->
select
()
->
toArray
();
return
SystemUploadFile
::
where
(
$map
)
->
field
(
$field
)
->
select
()
->
toArray
();
}
elseif
(
$datatype
==
'info'
)
{
$map
[]
=
[
'fileid'
,
'='
,
$fileid
];
return
SystemUploadFile
::
where
(
$map
)
->
find
();
return
SystemUploadFile
::
where
(
$map
)
->
fi
eld
(
$field
)
->
fi
nd
();
}
else
{
$fileinfo
=
(
new
SystemUploadFile
)
->
where
(
'fileid'
,
$fileid
)
->
find
();
$fileinfo
=
(
new
SystemUploadFile
)
->
field
(
$field
)
->
where
(
'fileid'
,
$fileid
)
->
find
();
return
isset
(
$fileinfo
[
'fileurl'
])
?
$fileinfo
[
'fileurl'
]
:
''
;
}
...
...
app/model/Course.php
View file @
bfbd5862
...
...
@@ -104,7 +104,7 @@ class Course extends Model
}
//获取课程详情
public
function
getCour
esDetail
(
$course_id
=
0
)
public
function
getCour
seDetail
(
$course_id
=
0
,
$userId
=
0
)
{
$where
=
[
'status'
=>
3
,
'is_sell'
=>
1
,
'is_del'
=>
0
];
if
(
$course_id
)
...
...
@@ -124,19 +124,16 @@ class Course extends Model
$detail
[
'is_learned'
]
=
0
;
//是否学习
$detail
[
'is_buy'
]
=
0
;
//是否购买
$token
=
request
()
->
header
(
'token'
);
$user
=
UserService
::
getUserInfo
(
$token
);
if
(
$user
)
if
(
$userId
)
{
$detail
[
'is_learned'
]
=
CourseProgress
::
where
([
'course_id'
=>
$detail
[
'id'
],
'user_id'
=>
$user
[
'id'
]
])
->
count
();
$detail
[
'is_learned'
]
=
CourseProgress
::
where
([
'course_id'
=>
$detail
[
'id'
],
'user_id'
=>
$user
Id
])
->
count
();
if
(
$detail
[
'price'
]
<
0
)
{
$detail
[
'is_buy'
]
=
1
;
}
else
{
$detail
[
'is_buy'
]
=
UtilService
::
checkPurchase
(
$user
[
'id'
]
,
$course_id
,
1
);
//是否购买
$detail
[
'is_buy'
]
=
UtilService
::
checkPurchase
(
$user
Id
,
$course_id
,
1
);
//是否购买
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment