|
@@ -40,7 +40,7 @@ class EmployeeService extends Service
|
|
$model->entry_time = $data['entry_time'] ?? '';
|
|
$model->entry_time = $data['entry_time'] ?? '';
|
|
$model->is_admin = $data['is_admin'];
|
|
$model->is_admin = $data['is_admin'];
|
|
if($model->is_admin == 1){
|
|
if($model->is_admin == 1){
|
|
- $model->account = $data['account'];
|
|
|
|
|
|
+ $model->account = $data['number'];
|
|
if($data['password'] !== '********'){
|
|
if($data['password'] !== '********'){
|
|
$model->password = Hash::make($data['password']);
|
|
$model->password = Hash::make($data['password']);
|
|
}
|
|
}
|
|
@@ -103,7 +103,7 @@ class EmployeeService extends Service
|
|
$model->crt_id = $user['id'];
|
|
$model->crt_id = $user['id'];
|
|
$model->is_admin = $data['is_admin'];
|
|
$model->is_admin = $data['is_admin'];
|
|
if($model->is_admin == 1){
|
|
if($model->is_admin == 1){
|
|
- $model->account = $data['account'];
|
|
|
|
|
|
+ $model->account = $data['number'];
|
|
if($data['password'] !== '********'){
|
|
if($data['password'] !== '********'){
|
|
$model->password = Hash::make($data['password']);
|
|
$model->password = Hash::make($data['password']);
|
|
}
|
|
}
|
|
@@ -236,17 +236,11 @@ class EmployeeService extends Service
|
|
$bool = Employee::where('number',$data['number'])
|
|
$bool = Employee::where('number',$data['number'])
|
|
->where('id','<>',$data['id'])
|
|
->where('id','<>',$data['id'])
|
|
->where('del_time',0)->exists();
|
|
->where('del_time',0)->exists();
|
|
- $bool_account = Employee::where('account',$data['account'])
|
|
|
|
- ->where('id','<>',$data['id'])
|
|
|
|
- ->where('del_time',0)->exists();
|
|
|
|
}else{
|
|
}else{
|
|
$bool = Employee::where('number',$data['number'])
|
|
$bool = Employee::where('number',$data['number'])
|
|
->where('del_time',0)->exists();
|
|
->where('del_time',0)->exists();
|
|
- $bool_account = Employee::where('account',$data['account'])
|
|
|
|
- ->where('del_time',0)->exists();
|
|
|
|
}
|
|
}
|
|
if($bool) return [false,'工号已存在!'];
|
|
if($bool) return [false,'工号已存在!'];
|
|
- if($bool_account) return [false,'账号已存在!'];
|
|
|
|
|
|
|
|
return [true,''];
|
|
return [true,''];
|
|
}
|
|
}
|