Commit 22773a47 authored by wangtao's avatar wangtao

接口修改

parent 703ae6db
...@@ -65,7 +65,12 @@ class Course extends BaseController ...@@ -65,7 +65,12 @@ class Course extends BaseController
} }
$data = $request->param(); $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); return $this->returnMsg('success',1,$list);
} }
......
...@@ -51,12 +51,10 @@ class CourseCategory extends Model ...@@ -51,12 +51,10 @@ class CourseCategory extends Model
* @throws \think\db\exception\DbException * @throws \think\db\exception\DbException
* @throws \think\db\exception\ModelNotFoundException * @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]; $where[] = ['is_del', '=', 0];
return $this->with(['children' => function ($query) use ($where) { return $this->with(['children' => function ($query) use ($where) {
$query->where($where); $query->where($where);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment