正在显示
1 个修改的文件
包含
10 行增加
和
1 行删除
| @@ -65,7 +65,16 @@ class CustomModuleContentController extends BaseController | @@ -65,7 +65,16 @@ class CustomModuleContentController extends BaseController | ||
| 65 | public function getCategoryList(){ | 65 | public function getCategoryList(){ |
| 66 | $categoryModel = new CustomModuleCategory(); | 66 | $categoryModel = new CustomModuleCategory(); |
| 67 | $list = $categoryModel->list(['project_id'=>$this->user['project_id'],'module_id'=>$this->param['module_id']],['id','name']); | 67 | $list = $categoryModel->list(['project_id'=>$this->user['project_id'],'module_id'=>$this->param['module_id']],['id','name']); |
| 68 | - $this->response('success',Code::SUCCESS,$list); | 68 | + $menu = []; |
| 69 | + if(!empty($list)){ | ||
| 70 | + foreach ($list as $v){ | ||
| 71 | + if($v['pid'] == 0){ | ||
| 72 | + $v['sub'] = _get_child($v['id'],$list); | ||
| 73 | + $menu[] = $v; | ||
| 74 | + } | ||
| 75 | + } | ||
| 76 | + } | ||
| 77 | + $this->response('success',Code::SUCCESS,$menu); | ||
| 69 | } | 78 | } |
| 70 | 79 | ||
| 71 | /** | 80 | /** |
-
请 注册 或 登录 后发表评论