|
|
@@ -58,16 +58,16 @@ class EmployeeService extends Service
|
|
|
DB::beginTransaction();
|
|
|
$model = new Employee();
|
|
|
$model = $model->where('id',$data['id'])->first();
|
|
|
- $model->number = $data['number'];
|
|
|
- $model->title = $data['title'];
|
|
|
- $model->mobile = $data['mobile'];
|
|
|
+ $model->number = $data['number'] ?? "";
|
|
|
+ $model->title = $data['title'] ?? "";
|
|
|
+ $model->mobile = $data['mobile'] ?? "";
|
|
|
$model->sex = $data['sex'] ?? 0;
|
|
|
$model->education = $data['education'] ?? "";
|
|
|
- $model->id_card = $data['id_card'];
|
|
|
+ $model->id_card = $data['id_card'] ?? "";
|
|
|
$model->major = $data['major'] ?? "";
|
|
|
$model->p_title = $data['p_title'] ?? "";
|
|
|
- $model->state = $data['state'];
|
|
|
- $model->is_admin = $data['is_admin'];
|
|
|
+ $model->state = $data['state'] ?? 0;
|
|
|
+ $model->is_admin = $data['is_admin'] ?? 0;
|
|
|
if($model->is_admin && $data['password'] !== '******') {
|
|
|
$model->password = Hash::make($data['password']);
|
|
|
$model->p_version = $model->p_version + 1;
|
|
|
@@ -118,18 +118,17 @@ class EmployeeService extends Service
|
|
|
try{
|
|
|
DB::beginTransaction();
|
|
|
$model = new Employee();
|
|
|
-
|
|
|
- $model->number = $data['number'];
|
|
|
- $model->title = $data['title'];
|
|
|
- $model->mobile = $data['mobile'];
|
|
|
+ $model->number = $data['number'] ?? "";
|
|
|
+ $model->title = $data['title'] ?? "";
|
|
|
+ $model->mobile = $data['mobile'] ?? "";
|
|
|
$model->sex = $data['sex'] ?? 0;
|
|
|
$model->education = $data['education'] ?? "";
|
|
|
- $model->id_card = $data['id_card'];
|
|
|
+ $model->id_card = $data['id_card'] ?? "";
|
|
|
$model->major = $data['major'] ?? "";
|
|
|
$model->p_title = $data['p_title'] ?? "";
|
|
|
- $model->state = $data['state'];
|
|
|
+ $model->state = $data['state'] ?? 0;
|
|
|
$model->crt_id = $user['id'];
|
|
|
- $model->is_admin = $data['is_admin'];
|
|
|
+ $model->is_admin = $data['is_admin'] ?? 0;
|
|
|
$model->account = $data['account'] ?? "";
|
|
|
if($model->is_admin) $model->password = Hash::make($data['password']);
|
|
|
$model->top_depart_id = $data['top_depart_id'];
|