|
@@ -64,14 +64,14 @@ class Resigninfo extends Base
|
|
|
public function create()
|
|
|
{
|
|
|
|
|
|
- $post = $this->request->only(['resign_uid', 'hand_uid', 'resign_date', 'expire_date', 'companyNo', 'is_hand' => 0, 'remark' => ''], 'post', 'trim');
|
|
|
+ $post = $this->request->only(['resign_uid', 'hand_uid', 'resign_date', 'expire_date', 'is_hand' => 0, 'remark' => ''], 'post', 'trim');
|
|
|
|
|
|
$val = Validate::rule([
|
|
|
'resign_uid|离职人' => 'require|number|gt:0',
|
|
|
'hand_uid|交接人' => 'require|number|gt:0',
|
|
|
'resign_date|离职日期' => 'require|date',
|
|
|
'expire_date|生效时间' => 'require|date',
|
|
|
- 'companyNo|所属公司' => 'require|max:255',
|
|
|
+// 'companyNo|所属公司' => 'require|max:255',
|
|
|
'is_hand|是否交接' => 'require|number|in:0,1',
|
|
|
'remark|备注' => 'max:255',
|
|
|
]);
|
|
@@ -79,7 +79,7 @@ class Resigninfo extends Base
|
|
|
if ($val->check($post) == false) return json_show(1004, $val->getError());
|
|
|
|
|
|
$userCommon = new \app\admin\common\User();
|
|
|
- $rs = $userCommon->handle('userlist', ['uid' => [$post['resign_uid'], $post['hand_uid']], 'companyNo' => $post['companyNo']]);
|
|
|
+ $rs = $userCommon->handle('userlist', ['uid' => [$post['resign_uid'], $post['hand_uid']]]);
|
|
|
$uid_nickname = array_column($rs['data']['list'], 'nickname', 'id');
|
|
|
|
|
|
if (!isset($uid_nickname[$post['resign_uid']])) return json_show(1004, '离职人不存在或不属于该公司');
|
|
@@ -90,7 +90,7 @@ class Resigninfo extends Base
|
|
|
|
|
|
$status = 0;
|
|
|
$data = [
|
|
|
- 'companyNo' => $post['companyNo'],
|
|
|
+// 'companyNo' => $post['companyNo'],
|
|
|
"resign_uid" => $post['resign_uid'],
|
|
|
"hand_uid" => $post['hand_uid'],
|
|
|
"resign_name" => $uid_nickname[$post['resign_uid']],
|
|
@@ -137,7 +137,7 @@ class Resigninfo extends Base
|
|
|
//编辑
|
|
|
public function edit()
|
|
|
{
|
|
|
- $post = $this->request->only(['id', 'resign_uid', 'hand_uid', 'resign_date', 'expire_date', 'companyNo', 'is_hand' => 0, 'remark' => ''], 'post', 'trim');
|
|
|
+ $post = $this->request->only(['id', 'resign_uid', 'hand_uid', 'resign_date', 'expire_date', 'is_hand' => 0, 'remark' => ''], 'post', 'trim');
|
|
|
|
|
|
$val = Validate::rule([
|
|
|
'id' => 'require|number|gt:0',
|
|
@@ -145,7 +145,7 @@ class Resigninfo extends Base
|
|
|
'hand_uid|交接人' => 'require|number|gt:0',
|
|
|
'resign_date|离职日期' => 'require|date',
|
|
|
'expire_date|生效时间' => 'require|date',
|
|
|
- 'companyNo|所属公司' => 'require|max:255',
|
|
|
+// 'companyNo|所属公司' => 'require|max:255',
|
|
|
'is_hand|是否交接' => 'require|number|in:0,1',
|
|
|
'remark|备注' => 'max:255',
|
|
|
]);
|
|
@@ -153,7 +153,7 @@ class Resigninfo extends Base
|
|
|
if ($val->check($post) == false) return json_show(1004, $val->getError());
|
|
|
|
|
|
$userCommon = new \app\admin\common\User();
|
|
|
- $rs = $userCommon->handle('userlist', ['uid' => [$post['resign_uid'], $post['hand_uid']], 'companyNo' => $post['companyNo']]);
|
|
|
+ $rs = $userCommon->handle('userlist', ['uid' => [$post['resign_uid'], $post['hand_uid']]]);
|
|
|
$uid_nickname = array_column($rs['data']['list'], 'nickname', 'id');
|
|
|
|
|
|
if (!isset($uid_nickname[$post['resign_uid']])) return json_show(1004, '离职人不存在或不属于该公司');
|
|
@@ -179,7 +179,7 @@ class Resigninfo extends Base
|
|
|
"is_hand" => $post['is_hand'],
|
|
|
"resign_date" => date('Y-m-d H:i:s'),
|
|
|
"is_del" => 0,
|
|
|
- 'companyNo' => $post['companyNo'],
|
|
|
+// 'companyNo' => $post['companyNo'],
|
|
|
"updatetime" => date('Y-m-d H:i:s'),
|
|
|
];
|
|
|
$it = Db::name('resign_info')->where(['is_del' => 0, 'id' => $post['id']])->save($str);
|