作者 lyh

gx

... ... @@ -51,11 +51,6 @@ class NavController extends BaseController
* @time :2023/12/4 15:04
*/
public function getSubList(NavLogic $logic){
$this->request->validate([
'id'=>'required',
],[
'id.required' => '产品ID不能为空',
]);
$data = $logic->getSubList();
$this->response('success',Code::SUCCESS,$data);
}
... ...
... ... @@ -34,11 +34,14 @@ class NavLogic extends BaseLogic
* @time :2023/12/4 15:11
*/
public function getSubList(){
$str = [];
//排序掉当前id下所有子集
$str = $this->getAllSub($this->param['id'],$str);
$str[] = $this->param['id'];
$this->param['id'] = ['not in',$str];
//编辑时
if(isset($this->param['id']) && !empty($this->param['id'])) {
$str = [];
//排序掉当前id下所有子集
$str = $this->getAllSub($this->param['id'], $str);
$str[] = $this->param['id'];
$this->param['id'] = ['not in', $str];
}
$this->param['project_id'] = $this->user['project_id'];
$list = $this->model->list($this->param);
$data = array();
... ...