generated from liutk/owl-admin-base
admin employee
parent
43979c5a67
commit
db841b778d
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Reference in New Issue