正在显示
2 个修改的文件
包含
7 行增加
和
10 行删除
| @@ -28,6 +28,7 @@ class NavController extends BaseController | @@ -28,6 +28,7 @@ class NavController extends BaseController | ||
| 28 | * @time 2023/5/8 16:37 | 28 | * @time 2023/5/8 16:37 |
| 29 | */ | 29 | */ |
| 30 | public function index(BNav $nav){ | 30 | public function index(BNav $nav){ |
| 31 | + $this->map['project_id'] = $this->user['project_id']; | ||
| 31 | $lists = $nav->list($this->map); | 32 | $lists = $nav->list($this->map); |
| 32 | $data = array(); | 33 | $data = array(); |
| 33 | foreach ($lists as $v){ | 34 | foreach ($lists as $v){ |
| @@ -41,16 +42,12 @@ class NavController extends BaseController | @@ -41,16 +42,12 @@ class NavController extends BaseController | ||
| 41 | } | 42 | } |
| 42 | 43 | ||
| 43 | 44 | ||
| 44 | - | ||
| 45 | - | ||
| 46 | /** | 45 | /** |
| 47 | - * 新增修改 | ||
| 48 | - * @return \Illuminate\Http\JsonResponse | ||
| 49 | - * @throws \Illuminate\Validation\ValidationException | ||
| 50 | - * @throws \Psr\Container\ContainerExceptionInterface | ||
| 51 | - * @throws \Psr\Container\NotFoundExceptionInterface | ||
| 52 | - * @author:dc | ||
| 53 | - * @time 2023/5/8 17:06 | 46 | + * @remark :保存数据 |
| 47 | + * @name :save | ||
| 48 | + * @author :lyh | ||
| 49 | + * @method :post | ||
| 50 | + * @time :2023/8/21 11:32 | ||
| 54 | */ | 51 | */ |
| 55 | public function save(NavRequest $request,NavLogic $logic){ | 52 | public function save(NavRequest $request,NavLogic $logic){ |
| 56 | $request->validated(); | 53 | $request->validated(); |
| @@ -27,7 +27,6 @@ class NavLogic extends BaseLogic | @@ -27,7 +27,6 @@ class NavLogic extends BaseLogic | ||
| 27 | public function navSave() | 27 | public function navSave() |
| 28 | { | 28 | { |
| 29 | if(isset($this->param['id']) && !empty($this->param['id'])){ | 29 | if(isset($this->param['id']) && !empty($this->param['id'])){ |
| 30 | - | ||
| 31 | $info = $this->model->read(['id'=>$this->param['id']]); | 30 | $info = $this->model->read(['id'=>$this->param['id']]); |
| 32 | if($this->param['pid'] == $info['id']){ | 31 | if($this->param['pid'] == $info['id']){ |
| 33 | $this->fail('不允许成为自己的上级'); | 32 | $this->fail('不允许成为自己的上级'); |
| @@ -38,6 +37,7 @@ class NavLogic extends BaseLogic | @@ -38,6 +37,7 @@ class NavLogic extends BaseLogic | ||
| 38 | } | 37 | } |
| 39 | $rs = $this->model->edit($this->param,['id'=>$this->param['id']]); | 38 | $rs = $this->model->edit($this->param,['id'=>$this->param['id']]); |
| 40 | }else{ | 39 | }else{ |
| 40 | + $this->param['project_id'] = $this->user['project_id']; | ||
| 41 | $rs = $this->model->add($this->param); | 41 | $rs = $this->model->add($this->param); |
| 42 | } | 42 | } |
| 43 | if($rs === false){ | 43 | if($rs === false){ |
-
请 注册 或 登录 后发表评论