作者 lyh

gx

... ... @@ -16,7 +16,7 @@ use App\Models\CustomModule\CustomModuleCategory;
class CustomModuleCategoryController extends BaseController
{
/**
* @remark :获取自定义模块列表
* @remark :获取自定义模块分类列表
* @name :ModuleList
* @author :lyh
* @method :post
... ... @@ -30,8 +30,34 @@ class CustomModuleCategoryController extends BaseController
]);
$this->map['project_id'] = $this->user['project_id'];
$this->map['status'] = 0;
$lists = $customModuleCategory->lists($this->map,$this->page,$this->row,$this->order);
$this->response('success',Code::SUCCESS,$lists);
$list = $customModuleCategory->list($this->map);
if(!empty($list)){
foreach ($list as $k => $v){
$v['url'] = $this->user['domain'].$v['route'];
$list[$k] = $v;
}
}
$data = $this->getListSon($list);
$this->response('success',Code::SUCCESS,$data);
}
/**
* @remark :无分页子集处理
* @name :getListSon
* @author :lyh
* @method :post
* @time :2023/8/17 11:12
*/
public function getListSon($list){
$data = array();
foreach ($list as $v){
$v = (array)$v;
if ($v['pid'] == 0) {
$v['sub'] = _get_child($v['id'], $list);
$data[] = $v;
}
}
return $data;
}
/**
... ...