|
...
|
...
|
@@ -133,16 +133,36 @@ class NavController extends BaseController |
|
|
|
$id = BNav::_save($this->user['project_id'],$data,$data['id']??0);
|
|
|
|
|
|
|
|
if($id===-1){
|
|
|
|
return $this->response('导航数据不存在','B_NAV_NOTFOUND');
|
|
|
|
return $this->response('导航菜单不存在','B_NAV_NOTFOUND');
|
|
|
|
}
|
|
|
|
|
|
|
|
return $this->success(BNav::_find($this->user['project_id'],$id,true));
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 删除数据
|
|
|
|
* @return \Illuminate\Http\JsonResponse
|
|
|
|
* @author:dc
|
|
|
|
* @time 2023/5/9 9:20
|
|
|
|
*/
|
|
|
|
public function delete(){
|
|
|
|
$id = $this->param['id']??0;
|
|
|
|
$data = BNav::_find($this->user['project_id'],$id);
|
|
|
|
|
|
|
|
if(empty($data)){
|
|
|
|
return $this->response('导航菜单不存在','B_NAV_NOTFOUND');
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public function delete(){
|
|
|
|
if(BNav::isChild($data['id'],$this->user['project_id'])){
|
|
|
|
return $this->response('存在下级无法删除','B_NAV_DELETE_CHILD');
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if($data->delete()){
|
|
|
|
return $this->response('删除成功',Code::SUCCESS);
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
...
|
...
|
|