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
22773a47
Commit
22773a47
authored
Aug 06, 2025
by
wangtao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
接口修改
parent
703ae6db
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
6 deletions
+9
-6
Course.php
app/api/controller/Course.php
+6
-1
CourseCategory.php
app/model/CourseCategory.php
+3
-5
No files found.
app/api/controller/Course.php
View file @
22773a47
...
...
@@ -65,7 +65,12 @@ class Course extends BaseController
}
$data
=
$request
->
param
();
$list
=
(
new
CourseCategoryModel
())
->
getCourseCategoryList
(
$data
[
'pid'
]
??
0
);
$limit
=
100
;
if
(
$data
[
'pid'
]
==
0
){
$limit
=
10
;
}
$list
=
(
new
CourseCategoryModel
())
->
getCourseCategoryList
(
$data
[
'pid'
]
??
0
,
$limit
);
return
$this
->
returnMsg
(
'success'
,
1
,
$list
);
}
...
...
app/model/CourseCategory.php
View file @
22773a47
...
...
@@ -51,12 +51,10 @@ class CourseCategory extends Model
* @throws \think\db\exception\DbException
* @throws \think\db\exception\ModelNotFoundException
*/
public
function
getCourseCategoryList
(
$pid
=
0
)
public
function
getCourseCategoryList
(
$pid
=
0
,
$limit
=
100
)
{
$limit
=
100
;
if
(
$pid
==
0
)
{
$limit
=
10
;
}
$where
[]
=
[
'is_del'
,
'='
,
0
];
return
$this
->
with
([
'children'
=>
function
(
$query
)
use
(
$where
)
{
$query
->
where
(
$where
);
...
...
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