diff --git a/app/Service/Admin/User/EmployeeService.php b/app/Service/Admin/User/EmployeeService.php index f6a2e71..85b5233 100644 --- a/app/Service/Admin/User/EmployeeService.php +++ b/app/Service/Admin/User/EmployeeService.php @@ -98,7 +98,7 @@ class EmployeeService extends BaseService if (!empty($oldName) && !empty($oldAccount)) throw new ErrException('账号或者员工已存在'); - $bindUserId = $this->request->input('bind_user_id', 0); + $bindUserId = (int)$this->request->input('bind_user_id', 0); if ($bindUserId > 0) { $oldBindUserId = $this->adminUserModel->getAdminInfoByBindUserId($bindUserId); if (!empty($oldBindUserId)) throw new ErrException('绑定用户已存在'); @@ -158,7 +158,7 @@ class EmployeeService extends BaseService if (!empty($oldName) && $oldName->id != $info->id) throw new ErrException('员工已存在'); if (!empty($oldAccount) && $oldAccount->id != $info->id) throw new ErrException('账号已存在'); - $bindUserId = $this->request->input('bind_user_id', 0); + $bindUserId = (int)$this->request->input('bind_user_id', 0); if ($bindUserId > 0) { $oldBindUserId = $this->adminUserModel->getAdminInfoByBindUserId($bindUserId); if (!empty($oldBindUserId) && $info->bind_user_id != $oldBindUserId) throw new ErrException('绑定用户已存在');