作者 lyh

gx

... ... @@ -28,6 +28,7 @@ class NavController extends BaseController
* @time 2023/5/8 16:37
*/
public function index(BNav $nav){
$this->map['project_id'] = $this->user['project_id'];
$lists = $nav->list($this->map);
$data = array();
foreach ($lists as $v){
... ... @@ -41,16 +42,12 @@ class NavController extends BaseController
}
/**
* 新增修改
* @return \Illuminate\Http\JsonResponse
* @throws \Illuminate\Validation\ValidationException
* @throws \Psr\Container\ContainerExceptionInterface
* @throws \Psr\Container\NotFoundExceptionInterface
* @author:dc
* @time 2023/5/8 17:06
* @remark :保存数据
* @name :save
* @author :lyh
* @method :post
* @time :2023/8/21 11:32
*/
public function save(NavRequest $request,NavLogic $logic){
$request->validated();
... ...
... ... @@ -27,7 +27,6 @@ class NavLogic extends BaseLogic
public function navSave()
{
if(isset($this->param['id']) && !empty($this->param['id'])){
$info = $this->model->read(['id'=>$this->param['id']]);
if($this->param['pid'] == $info['id']){
$this->fail('不允许成为自己的上级');
... ... @@ -38,6 +37,7 @@ class NavLogic extends BaseLogic
}
$rs = $this->model->edit($this->param,['id'=>$this->param['id']]);
}else{
$this->param['project_id'] = $this->user['project_id'];
$rs = $this->model->add($this->param);
}
if($rs === false){
... ...