合并分支 'master-server' 到 'master'
更新人事信息 查看合并请求 !663
正在显示
6 个修改的文件
包含
15 行增加
和
9 行删除
| @@ -59,6 +59,6 @@ class TemplateLog extends Command | @@ -59,6 +59,6 @@ class TemplateLog extends Command | ||
| 59 | * @time :2024/7/10 14:48 | 59 | * @time :2024/7/10 14:48 |
| 60 | */ | 60 | */ |
| 61 | public function deleteTemplate(){ | 61 | public function deleteTemplate(){ |
| 62 | - | 62 | + $templateLogModel = new TemplateLog(); |
| 63 | } | 63 | } |
| 64 | } | 64 | } |
| @@ -54,6 +54,15 @@ class HrController extends BaseController | @@ -54,6 +54,15 @@ class HrController extends BaseController | ||
| 54 | * @time :2023/9/6 10:05 | 54 | * @time :2023/9/6 10:05 |
| 55 | */ | 55 | */ |
| 56 | public function save(HrLogic $logic){ | 56 | public function save(HrLogic $logic){ |
| 57 | + $this->request->validate([ | ||
| 58 | + 'name'=>'required', | ||
| 59 | + 'mobile'=>'required', | ||
| 60 | + 'status'=>'required' | ||
| 61 | + ],[ | ||
| 62 | + 'name.required' => '名称不能为空', | ||
| 63 | + 'mobile.required' => '手机号码不能为空', | ||
| 64 | + 'status.required' => '请选择用户状态', | ||
| 65 | + ]); | ||
| 57 | $logic->hrSave(); | 66 | $logic->hrSave(); |
| 58 | $this->response('success'); | 67 | $this->response('success'); |
| 59 | } | 68 | } |
| @@ -417,9 +417,11 @@ class ProjectController extends BaseController | @@ -417,9 +417,11 @@ class ProjectController extends BaseController | ||
| 417 | public function save(ProjectLogic $logic) | 417 | public function save(ProjectLogic $logic) |
| 418 | { | 418 | { |
| 419 | $this->request->validate([ | 419 | $this->request->validate([ |
| 420 | - 'type'=>'required' | 420 | + 'type'=>'required', |
| 421 | + 'serve_id'=>'required', | ||
| 421 | ],[ | 422 | ],[ |
| 422 | - 'type.required' => '类型不能为空' | 423 | + 'type.required' => '类型不能为空', |
| 424 | + 'serve_id.required' => '请选择服务器' | ||
| 423 | ]); | 425 | ]); |
| 424 | $logic->projectSave(); | 426 | $logic->projectSave(); |
| 425 | $this->response('success'); | 427 | $this->response('success'); |
| @@ -75,10 +75,8 @@ class HrLogic extends BaseLogic | @@ -75,10 +75,8 @@ class HrLogic extends BaseLogic | ||
| 75 | $managerModel = new Manage(); | 75 | $managerModel = new Manage(); |
| 76 | $this->param['manage_id'] = $managerModel->addReturnId($data); | 76 | $this->param['manage_id'] = $managerModel->addReturnId($data); |
| 77 | $this->model->add($this->param); | 77 | $this->model->add($this->param); |
| 78 | - | ||
| 79 | //同步到B端演示项目 | 78 | //同步到B端演示项目 |
| 80 | $this->syncBProjectUser($this->param['mobile'], $this->param['mobile'], $this->param['name'], $this->param['status']); | 79 | $this->syncBProjectUser($this->param['mobile'], $this->param['mobile'], $this->param['name'], $this->param['status']); |
| 81 | - | ||
| 82 | DB::commit(); | 80 | DB::commit(); |
| 83 | }catch (\Exception $e){ | 81 | }catch (\Exception $e){ |
| 84 | DB::rollBack(); | 82 | DB::rollBack(); |
| @@ -148,7 +148,7 @@ class ProjectLogic extends BaseLogic | @@ -148,7 +148,7 @@ class ProjectLogic extends BaseLogic | ||
| 148 | //初始化项目 | 148 | //初始化项目 |
| 149 | $this->createProjectData($this->param); | 149 | $this->createProjectData($this->param); |
| 150 | //双向绑定服务器,需放到保存项目的上方 | 150 | //双向绑定服务器,需放到保存项目的上方 |
| 151 | - $this->setServers($this->param['serve_id'] ?? 0,$this->param['id']); | 151 | + $this->setServers($this->param['serve_id'],$this->param['id']); |
| 152 | //保存项目信息 | 152 | //保存项目信息 |
| 153 | $this->saveProject($this->param); | 153 | $this->saveProject($this->param); |
| 154 | //保存建站部署信息 | 154 | //保存建站部署信息 |
| @@ -16,18 +16,15 @@ class TaskOwnerLogic extends BaseLogic | @@ -16,18 +16,15 @@ class TaskOwnerLogic extends BaseLogic | ||
| 16 | public function __construct() | 16 | public function __construct() |
| 17 | { | 17 | { |
| 18 | parent::__construct(); | 18 | parent::__construct(); |
| 19 | - | ||
| 20 | $this->model = new TaskOwner(); | 19 | $this->model = new TaskOwner(); |
| 21 | } | 20 | } |
| 22 | 21 | ||
| 23 | public function save($param){ | 22 | public function save($param){ |
| 24 | //获取已分配了的 | 23 | //获取已分配了的 |
| 25 | $manage_ids = $this->model->where('task_id', $param['task_id'])->pluck('manage_id', 'id')->toArray(); | 24 | $manage_ids = $this->model->where('task_id', $param['task_id'])->pluck('manage_id', 'id')->toArray(); |
| 26 | - | ||
| 27 | //待删除的 | 25 | //待删除的 |
| 28 | $del_manage_ids = array_diff($manage_ids, $param['manage_ids']); | 26 | $del_manage_ids = array_diff($manage_ids, $param['manage_ids']); |
| 29 | $this->delete(array_keys($del_manage_ids)); | 27 | $this->delete(array_keys($del_manage_ids)); |
| 30 | - | ||
| 31 | //新增的 | 28 | //新增的 |
| 32 | $add_manage_ids = array_diff($param['manage_ids'], $manage_ids); | 29 | $add_manage_ids = array_diff($param['manage_ids'], $manage_ids); |
| 33 | foreach ($add_manage_ids as $add_manage_id){ | 30 | foreach ($add_manage_ids as $add_manage_id){ |
-
请 注册 或 登录 后发表评论