admin employee

main
panliang 2024-04-30 16:28:23 +08:00
parent 43979c5a67
commit db841b778d
1 changed files with 4 additions and 4 deletions

View File

@ -95,11 +95,11 @@ class EmployeeService extends BaseService
*/
public function leave(Employee $user, $options = [])
{
// 店长不能离职
if ($user->isStoreMaster()) {
return $this->setError('请先设置新店长');
}
if ($user->employee_status == EmployeeStatus::Online) {
// 店长不能离职
if ($user->isStoreMaster()) {
return $this->setError('请先设置新店长');
}
$user->update([
'leave_at' => data_get($options, 'leave_at', now()),
'employee_status' => EmployeeStatus::Offline,