Merge branch 'develop' of http://47.244.231.31:8099/zhl/globalso-v6 into develop
正在显示
2 个修改的文件
包含
57 行增加
和
4 行删除
| @@ -2,7 +2,9 @@ | @@ -2,7 +2,9 @@ | ||
| 2 | 2 | ||
| 3 | namespace App\Http\Controllers\Aside\User; | 3 | namespace App\Http\Controllers\Aside\User; |
| 4 | 4 | ||
| 5 | +use App\Enums\Common\Code; | ||
| 5 | use App\Http\Controllers\Aside\BaseController; | 6 | use App\Http\Controllers\Aside\BaseController; |
| 7 | +use App\Http\Logic\Aside\User\DeptLogic; | ||
| 6 | 8 | ||
| 7 | /** | 9 | /** |
| 8 | * @remark :b端用户组织架构 | 10 | * @remark :b端用户组织架构 |
| @@ -18,8 +20,9 @@ class ProjectDeptController extends BaseController | @@ -18,8 +20,9 @@ class ProjectDeptController extends BaseController | ||
| 18 | * @method :post | 20 | * @method :post |
| 19 | * @time :2023/6/17 16:13 | 21 | * @time :2023/6/17 16:13 |
| 20 | */ | 22 | */ |
| 21 | - public function lists(){ | ||
| 22 | - | 23 | + public function lists(DeptLogic $deptLogic){ |
| 24 | + $lists = $deptLogic->DeptLists($this->map,$this->page,$this->row,$this->order); | ||
| 25 | + $this->response('success',Code::SUCCESS,$lists); | ||
| 23 | } | 26 | } |
| 24 | 27 | ||
| 25 | /** | 28 | /** |
| @@ -28,8 +31,14 @@ class ProjectDeptController extends BaseController | @@ -28,8 +31,14 @@ class ProjectDeptController extends BaseController | ||
| 28 | * @method :post | 31 | * @method :post |
| 29 | * @time :2023/6/17 16:13 | 32 | * @time :2023/6/17 16:13 |
| 30 | */ | 33 | */ |
| 31 | - public function read(){ | ||
| 32 | - | 34 | + public function read(DeptLogic $deptLogic){ |
| 35 | + $this->request->validate([ | ||
| 36 | + 'id'=>'required' | ||
| 37 | + ],[ | ||
| 38 | + 'id.required' => 'ID不能为空' | ||
| 39 | + ]); | ||
| 40 | + $info = $deptLogic->DeptRead(); | ||
| 41 | + $this->response('success',Code::SUCCESS,$info); | ||
| 33 | } | 42 | } |
| 34 | 43 | ||
| 35 | } | 44 | } |
app/Http/Logic/Aside/User/DeptLogic.php
0 → 100644
| 1 | +<?php | ||
| 2 | + | ||
| 3 | +namespace App\Http\Logic\Aside\User; | ||
| 4 | + | ||
| 5 | +use App\Http\Logic\Aside\BaseLogic; | ||
| 6 | +use App\Models\User\ProjectDept; | ||
| 7 | + | ||
| 8 | +class DeptLogic extends BaseLogic | ||
| 9 | +{ | ||
| 10 | + public function __construct() | ||
| 11 | + { | ||
| 12 | + parent::__construct(); | ||
| 13 | + $this->model = new ProjectDept(); | ||
| 14 | + $this->param = $this->requestAll; | ||
| 15 | + } | ||
| 16 | + | ||
| 17 | + /** | ||
| 18 | + * @remark :Dept组织价格列表 | ||
| 19 | + * @name :DeptLists | ||
| 20 | + * @author :lyh | ||
| 21 | + * @method :post | ||
| 22 | + * @time :2023/6/21 14:56 | ||
| 23 | + */ | ||
| 24 | + public function DeptLists($map,$page,$row,$order = 'created_at',$filed = ['*']){ | ||
| 25 | + $lists = $this->model->lists($map,$page,$row,$order,$filed); | ||
| 26 | + return $this->success($lists); | ||
| 27 | + } | ||
| 28 | + | ||
| 29 | + /** | ||
| 30 | + * @remark :组织架构详情 | ||
| 31 | + * @name :DeptRead | ||
| 32 | + * @author :lyh | ||
| 33 | + * @method :post | ||
| 34 | + * @time :2023/6/21 15:01 | ||
| 35 | + */ | ||
| 36 | + public function DeptRead(){ | ||
| 37 | + $info = $this->model->read($this->param); | ||
| 38 | + if($info === false){ | ||
| 39 | + $this->fail('当前数据不存在,或者被删除'); | ||
| 40 | + } | ||
| 41 | + return $this->success($info); | ||
| 42 | + } | ||
| 43 | + | ||
| 44 | +} |
-
请 注册 或 登录 后发表评论