作者 lyh

gx

@@ -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 /**