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
4f6b7a9a
Commit
4f6b7a9a
authored
Jul 04, 2025
by
wangzhengwen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
课程
parent
bcd34a6e
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
3 deletions
+11
-3
CourseUserWork.php
app/api/controller/manage/CourseUserWork.php
+4
-2
Course.php
app/model/Course.php
+6
-0
CourseUserWork.php
app/model/CourseUserWork.php
+1
-1
No files found.
app/api/controller/manage/CourseUserWork.php
View file @
4f6b7a9a
...
...
@@ -35,9 +35,11 @@ class CourseUserWork extends BaseController
$page
=
$request
->
param
(
'page'
,
1
);
$pageSize
=
$request
->
param
(
'pageSize'
,
10
);
$list
=
CourseUserWorkModel
::
where
(
$where
)
->
where
(
'course_user_work.status'
,
'>'
,
0
)
->
hasWhere
(
'userprofile'
,
$map
)
$list
=
CourseUserWorkModel
::
where
(
$where
)
->
where
(
'course_user_work.status'
,
'>'
,
0
)
->
hasWhere
(
'userprofile'
,
$map
)
->
order
(
'createtime desc'
)
->
with
([
'userprofile'
])
->
with
([
'userprofile'
,
'course'
])
->
append
([
'status_text'
])
->
paginate
([
'page'
=>
$page
,
...
...
app/model/Course.php
View file @
4f6b7a9a
...
...
@@ -231,5 +231,11 @@ class Course extends Model
->
field
(
'fileid,filename,filesize,fileurl,filetype'
);
}
public
function
courseCategory
()
{
return
$this
->
hasMany
(
\app\model\CourseCategory
::
class
,
'cate_id'
,
'id'
)
->
field
(
'id,title'
);
}
}
\ No newline at end of file
app/model/CourseUserWork.php
View file @
4f6b7a9a
...
...
@@ -113,7 +113,7 @@ class CourseUserWork extends Model
//关联课程
public
function
course
()
{
return
$this
->
hasOne
(
Course
::
class
,
'id'
,
'course_id'
)
->
where
(
'is_del'
,
0
)
->
field
(
'id,title'
);
return
$this
->
hasOne
(
Course
::
class
,
'id'
,
'course_id'
)
->
where
(
'is_del'
,
0
)
->
field
(
'id,title
,cate_id
'
);
}
//关联用户学校
...
...
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