更新人事离职

This commit is contained in:
yaooo 2023-10-30 14:17:15 +08:00
parent b0a044009b
commit faafe997a0
2 changed files with 8 additions and 2 deletions

View File

@ -153,6 +153,9 @@ class UserPersonal extends ApiController
public function leave_delete() public function leave_delete()
{ {
$id = get_params("id"); $id = get_params("id");
if (empty($id)) {
$this->apiError("请选择离职人员");
}
$data['status'] = '-1'; $data['status'] = '-1';
$data['id'] = $id; $data['id'] = $id;
$data['update_time'] = time(); $data['update_time'] = time();
@ -160,9 +163,9 @@ class UserPersonal extends ApiController
$uid = Db::name('PersonalQuit')->where('id', $id)->value('uid'); $uid = Db::name('PersonalQuit')->where('id', $id)->value('uid');
Db::name('Admin')->where('id', $uid)->update(['status' => 1]); Db::name('Admin')->where('id', $uid)->update(['status' => 1]);
add_log('delete', $id); add_log('delete', $id);
return to_assign(0, "删除成功"); $this->apiError("删除成功");
} else { } else {
return to_assign(1, "删除失败"); $this->apiError("删除失败");
} }
} }
} }

View File

@ -111,6 +111,9 @@ class UserPosition extends ApiController
{ {
$this->checkAuth(); $this->checkAuth();
$id = get_params("id"); $id = get_params("id");
if (empty($id)) {
$this->apiError("请选择岗位");
}
if ($id == 1) { if ($id == 1) {
$this->apiError("超级岗位不能删除"); $this->apiError("超级岗位不能删除");
} }