|
@@ -72,6 +72,7 @@ class EmployeeService extends Service
|
|
|
$model->position = $data['position'] ?? "";
|
|
$model->position = $data['position'] ?? "";
|
|
|
$model->p_title = $data['p_title'] ?? "";
|
|
$model->p_title = $data['p_title'] ?? "";
|
|
|
$model->state = $data['state'] ?? 0;
|
|
$model->state = $data['state'] ?? 0;
|
|
|
|
|
+ $model->employee_type = $data['employee_type'] ?? 0;
|
|
|
$model->is_admin = $data['is_admin'] ?? 0;
|
|
$model->is_admin = $data['is_admin'] ?? 0;
|
|
|
$model->entrust_type = $data['entrust_type'] ?? 0;
|
|
$model->entrust_type = $data['entrust_type'] ?? 0;
|
|
|
$model->man_type = $data['man_type'] ?? 0;
|
|
$model->man_type = $data['man_type'] ?? 0;
|
|
@@ -176,6 +177,7 @@ class EmployeeService extends Service
|
|
|
$model->position = $data['position'] ?? "";
|
|
$model->position = $data['position'] ?? "";
|
|
|
$model->p_title = $data['p_title'] ?? "";
|
|
$model->p_title = $data['p_title'] ?? "";
|
|
|
$model->state = $data['state'] ?? 0;
|
|
$model->state = $data['state'] ?? 0;
|
|
|
|
|
+ $model->employee_type = $data['employee_type'] ?? 0;
|
|
|
$model->crt_id = $user['id'];
|
|
$model->crt_id = $user['id'];
|
|
|
$model->is_admin = $data['is_admin'] ?? 0;
|
|
$model->is_admin = $data['is_admin'] ?? 0;
|
|
|
$model->account = $data['account'] ?? "";
|
|
$model->account = $data['account'] ?? "";
|
|
@@ -385,6 +387,7 @@ class EmployeeService extends Service
|
|
|
// 业务状态字段
|
|
// 业务状态字段
|
|
|
$item['is_admin_title'] = Employee::IS_ADMIN_TITLE[$item['is_admin']] ?? "";
|
|
$item['is_admin_title'] = Employee::IS_ADMIN_TITLE[$item['is_admin']] ?? "";
|
|
|
$item['state_title'] = Employee::State_Type[$item['state']] ?? "";
|
|
$item['state_title'] = Employee::State_Type[$item['state']] ?? "";
|
|
|
|
|
+ $item['employee_type_title'] = Employee::E_State_Type[$item['employee_type']] ?? "";
|
|
|
$item['sex_title'] = Employee::SEX_TYPE[$item['sex']] ?? "";
|
|
$item['sex_title'] = Employee::SEX_TYPE[$item['sex']] ?? "";
|
|
|
$item['man_type_title'] = Employee::Man_Type[$item['man_type']] ?? "";
|
|
$item['man_type_title'] = Employee::Man_Type[$item['man_type']] ?? "";
|
|
|
$item['entrust_type_title'] = Employee::WT_Type[$item['entrust_type']] ?? "";
|
|
$item['entrust_type_title'] = Employee::WT_Type[$item['entrust_type']] ?? "";
|
|
@@ -568,6 +571,7 @@ class EmployeeService extends Service
|
|
|
$sexMap = Employee::SEX_TYPE;
|
|
$sexMap = Employee::SEX_TYPE;
|
|
|
$eduMap = Employee::Education;
|
|
$eduMap = Employee::Education;
|
|
|
$stateMap = Employee::State_Type;
|
|
$stateMap = Employee::State_Type;
|
|
|
|
|
+ $eMap = Employee::E_State_Type;
|
|
|
|
|
|
|
|
foreach ($dataArray as $main) {
|
|
foreach ($dataArray as $main) {
|
|
|
$empId = $main['id'];
|
|
$empId = $main['id'];
|
|
@@ -578,6 +582,7 @@ class EmployeeService extends Service
|
|
|
$mainInfo['sex_title'] = $sexMap[$main['sex']] ?? '';
|
|
$mainInfo['sex_title'] = $sexMap[$main['sex']] ?? '';
|
|
|
$mainInfo['education_title'] = $eduMap[$main['education']] ?? '';
|
|
$mainInfo['education_title'] = $eduMap[$main['education']] ?? '';
|
|
|
$mainInfo['state_title'] = $stateMap[$main['state']] ?? '';
|
|
$mainInfo['state_title'] = $stateMap[$main['state']] ?? '';
|
|
|
|
|
+ $mainInfo['employee_type_title'] = $eMap[$main['employee_type']] ?? '';
|
|
|
|
|
|
|
|
if (empty($details)) {
|
|
if (empty($details)) {
|
|
|
// 如果没部门,保底出一行
|
|
// 如果没部门,保底出一行
|
|
@@ -634,12 +639,14 @@ class EmployeeService extends Service
|
|
|
if(! empty($data['sex']) && ! isset(Employee::SEX_TYPE[$data['sex']])) return [false, '性别不存在'];
|
|
if(! empty($data['sex']) && ! isset(Employee::SEX_TYPE[$data['sex']])) return [false, '性别不存在'];
|
|
|
if(empty($data['mobile'])) return [false,'联系电话不能为空'];
|
|
if(empty($data['mobile'])) return [false,'联系电话不能为空'];
|
|
|
// if(! $this->isValidPhone($data['mobile'])) return [false, '手机号码格式错误'];
|
|
// if(! $this->isValidPhone($data['mobile'])) return [false, '手机号码格式错误'];
|
|
|
- if(empty($data['major'])) return [false, '专业领域不能为空'];
|
|
|
|
|
|
|
+// if(empty($data['major'])) return [false, '专业领域不能为空'];
|
|
|
if(! empty($data['education']) && ! isset(Employee::Education[$data['education']])) return [false, '学历不存在'];
|
|
if(! empty($data['education']) && ! isset(Employee::Education[$data['education']])) return [false, '学历不存在'];
|
|
|
if(empty($data['id_card'])) return [false, '身份证号不能为空'];
|
|
if(empty($data['id_card'])) return [false, '身份证号不能为空'];
|
|
|
if(empty($data['depart'])) return [false,'部门不能为空'];
|
|
if(empty($data['depart'])) return [false,'部门不能为空'];
|
|
|
if(empty($data['state'])) return [false,'状态不能为空'];
|
|
if(empty($data['state'])) return [false,'状态不能为空'];
|
|
|
if(! isset(Employee::State_Type[$data['state']])) return [false,'状态不存在'];
|
|
if(! isset(Employee::State_Type[$data['state']])) return [false,'状态不存在'];
|
|
|
|
|
+ if(empty($data['employee_type'])) return [false,'聘用类型不能为空'];
|
|
|
|
|
+ if(! isset(Employee::E_State_Type[$data['employee_type']])) return [false,'聘用类型不存在'];
|
|
|
if(! empty($data['is_admin'])){
|
|
if(! empty($data['is_admin'])){
|
|
|
if(! isset(Employee::IS_ADMIN_TITLE_SIMPLE[$data['is_admin']])) return [false, 'is_admin类型不存在'];
|
|
if(! isset(Employee::IS_ADMIN_TITLE_SIMPLE[$data['is_admin']])) return [false, 'is_admin类型不存在'];
|
|
|
if(empty($data['password'])) return [false, '密码不能为空'];
|
|
if(empty($data['password'])) return [false, '密码不能为空'];
|