This commit is contained in:
weiz 2024-05-23 11:36:12 +08:00
parent 0db4bfe7da
commit 947e2b7e31
3 changed files with 10 additions and 13 deletions

View File

@ -145,7 +145,6 @@ class AdminController extends BaseAdminController
$item['job_name'] = $job->isEmpty() ? '' : $job['name'];
$item['dept_name'] = $dept->isEmpty() ? '' : $dept['name'];
$item['org_name'] = $org->isEmpty() ? '' : $org['name'];
unset($item['org_id'],$item['dept_id'],$item['job_id']);
return $item;
})->toArray();
foreach($data as $k=>$v){
@ -168,7 +167,6 @@ class AdminController extends BaseAdminController
$item['job_name'] = $job->isEmpty() ? '' : $job['name'];
$item['dept_name'] = $dept->isEmpty() ? '' : $dept['name'];
$item['org_name'] = $org->isEmpty() ? '' : $org['name'];
unset($item['org_id'],$item['dept_id'],$item['job_id']);
return $item;
})->toArray();
foreach($data as $k=>$v){
@ -191,7 +189,6 @@ class AdminController extends BaseAdminController
$item['job_name'] = $job->isEmpty() ? '' : $job['name'];
$item['dept_name'] = $dept->isEmpty() ? '' : $dept['name'];
$item['org_name'] = $org->isEmpty() ? '' : $org['name'];
unset($item['org_id'],$item['dept_id'],$item['job_id']);
return $item;
})->toArray();
foreach($data as $k=>$v){

View File

@ -66,9 +66,9 @@ class AdminLogic extends BaseLogic
'dept_id' => $params['dept_id'],
'job_id' => $params['job_id'],
'email' => $params['email'] ?? '',
'mobile' => $params['mobile'],
'mobile' => $params['mobile'] ?? '',
'sex' => $params['sex'] ?? 0,
'type' => $params['type'],
'type' => $params['type'] ?? 0,
'age' => $params['age'] ?? 0,
'native_place' => $params['native_place'] ?? '',
'idcard' => $params['idcard'] ?? '',
@ -77,7 +77,7 @@ class AdminLogic extends BaseLogic
'bank_info' => $params['bank_info'] ?? '',
'desc' => $params['desc'] ?? null,
'entry_time' => !empty($params['entry_time']) ? strtotime($params['entry_time']) : 0,
'status' => $params['status'],
'status' => $params['status'] ?? 1,
]);
// 角色
self::insertRole($admin['id'], $params['role_id'] ?? []);
@ -113,9 +113,9 @@ class AdminLogic extends BaseLogic
'dept_id' => $params['dept_id'],
'job_id' => $params['job_id'],
'email' => $params['email'] ?? '',
'mobile' => $params['mobile'],
'mobile' => $params['mobile'] ?? '',
'sex' => $params['sex'] ?? 0,
'type' => $params['type'],
'type' => $params['type'] ?? 0,
'age' => $params['age'] ?? 0,
'native_place' => $params['native_place'] ?? '',
'idcard' => $params['idcard'] ?? '',
@ -124,7 +124,7 @@ class AdminLogic extends BaseLogic
'bank_info' => $params['bank_info'] ?? '',
'desc' => $params['desc'] ?? null,
'entry_time' => !empty($params['entry_time']) ? strtotime($params['entry_time']) : 0,
'status' => $params['status'],
'status' => $params['status'] ?? 1,
];
// 头像

View File

@ -40,13 +40,13 @@
'dept_id' => 'requireWith:org_id|checkDept',
'job_id' => 'requireWith:dept_id|checkJob',
'email' => 'email',
'mobile' => 'require|mobile|unique:oa_admin',
'mobile' => 'mobile|unique:oa_admin',
'sex' => 'integer|in:0,1,2',
'age' => 'integer|gt:0',
'idcard' => 'idCard',
'entry_time' => 'require|dateFormat:Y-m-d',
'type' => 'require|integer|in:0,1,2',
'status' => 'require|integer|in:0,1,2',
'entry_time' => 'dateFormat:Y-m-d',
'type' => 'integer|in:0,1,2',
'status' => 'integer|in:0,1,2',
];
protected $message = [