|
@@ -39,7 +39,8 @@ class HrLogic extends BaseLogic |
|
@@ -39,7 +39,8 @@ class HrLogic extends BaseLogic |
|
39
|
* @time :2023/9/6 10:17
|
39
|
* @time :2023/9/6 10:17
|
|
40
|
*/
|
40
|
*/
|
|
41
|
public function hrSave(){
|
41
|
public function hrSave(){
|
|
42
|
- //处理参数
|
42
|
+ $this->handleParam();
|
|
|
|
43
|
+ //处理参数
|
|
43
|
foreach ($this->model::specieField() as $v){
|
44
|
foreach ($this->model::specieField() as $v){
|
|
44
|
$this->param = $this->setJson($v,$this->param);
|
45
|
$this->param = $this->setJson($v,$this->param);
|
|
45
|
}
|
46
|
}
|
|
@@ -52,6 +53,22 @@ class HrLogic extends BaseLogic |
|
@@ -52,6 +53,22 @@ class HrLogic extends BaseLogic |
|
52
|
}
|
53
|
}
|
|
53
|
|
54
|
|
|
54
|
/**
|
55
|
/**
|
|
|
|
56
|
+ * @remark :处理字段
|
|
|
|
57
|
+ * @name :handleParam
|
|
|
|
58
|
+ * @author :lyh
|
|
|
|
59
|
+ * @method :post
|
|
|
|
60
|
+ * @time :2024/7/10 16:32
|
|
|
|
61
|
+ */
|
|
|
|
62
|
+ public function handleParam(){
|
|
|
|
63
|
+ $this->param['status'] = empty($this->param['status']) ? 1 : $this->param['status'];
|
|
|
|
64
|
+ $this->param['education'] = empty($this->param['education']) ? 1 : $this->param['education'];
|
|
|
|
65
|
+ $this->param['entry_position'] = empty($this->param['entry_position']) ? 1 : $this->param['entry_position'];
|
|
|
|
66
|
+ $this->param['p_level'] = empty($this->param['p_level']) ? 1 : $this->param['p_level'];
|
|
|
|
67
|
+ $this->param['dept_id'] = empty($this->param['dept_id']) ? 1 : $this->param['dept_id'];
|
|
|
|
68
|
+ $this->param['belong_group'] = empty($this->param['belong_group']) ? 1 : $this->param['belong_group'];
|
|
|
|
69
|
+ }
|
|
|
|
70
|
+
|
|
|
|
71
|
+ /**
|
|
55
|
* @remark :添加人事信息时 同步添加管理员账号
|
72
|
* @remark :添加人事信息时 同步添加管理员账号
|
|
56
|
* @name :addManager
|
73
|
* @name :addManager
|
|
57
|
* @author :lyh
|
74
|
* @author :lyh
|
|
@@ -70,18 +87,18 @@ class HrLogic extends BaseLogic |
|
@@ -70,18 +87,18 @@ class HrLogic extends BaseLogic |
|
70
|
'password'=>Hash::make('globalsov6'),
|
87
|
'password'=>Hash::make('globalsov6'),
|
|
71
|
'gid'=>4,
|
88
|
'gid'=>4,
|
|
72
|
];
|
89
|
];
|
|
73
|
-// DB::beginTransaction();
|
|
|
|
74
|
-// try {
|
90
|
+ DB::beginTransaction();
|
|
|
|
91
|
+ try {
|
|
75
|
$managerModel = new Manage();
|
92
|
$managerModel = new Manage();
|
|
76
|
$this->param['manage_id'] = $managerModel->addReturnId($data);
|
93
|
$this->param['manage_id'] = $managerModel->addReturnId($data);
|
|
77
|
$this->model->add($this->param);
|
94
|
$this->model->add($this->param);
|
|
78
|
//同步到B端演示项目
|
95
|
//同步到B端演示项目
|
|
79
|
$this->syncBProjectUser($this->param['mobile'], $this->param['mobile'], $this->param['name'], $this->param['status']);
|
96
|
$this->syncBProjectUser($this->param['mobile'], $this->param['mobile'], $this->param['name'], $this->param['status']);
|
|
80
|
-// DB::commit();
|
|
|
|
81
|
-// }catch (\Exception $e){
|
|
|
|
82
|
-// DB::rollBack();
|
|
|
|
83
|
-// $this->fail('系统错误请联系管理员');
|
|
|
|
84
|
-// }
|
97
|
+ DB::commit();
|
|
|
|
98
|
+ }catch (\Exception $e){
|
|
|
|
99
|
+ DB::rollBack();
|
|
|
|
100
|
+ $this->fail('系统错误请联系管理员');
|
|
|
|
101
|
+ }
|
|
85
|
return $this->success();
|
102
|
return $this->success();
|
|
86
|
}
|
103
|
}
|
|
87
|
|
104
|
|