|
@@ -138,6 +138,7 @@ class Admin extends Backend
|
|
|
$params['avatar'] = '/assets/img/avatar.png'; //设置新管理员默认头像。
|
|
|
//公司
|
|
|
$params['company_id'] = $this->request->post('company_id');
|
|
|
+ $params['staff_id'] = $this->request->post('staff_id');
|
|
|
//公司
|
|
|
$result = $this->model->validate('Admin.add')->save($params);
|
|
|
if ($result === false) {
|
|
@@ -197,6 +198,7 @@ class Admin extends Backend
|
|
|
}
|
|
|
//公司
|
|
|
$params['company_id'] = $this->request->post('company_id');
|
|
|
+ $params['staff_id'] = $this->request->post('staff_id');
|
|
|
//公司
|
|
|
|
|
|
//这里需要针对username和email做唯一验证
|
|
@@ -204,7 +206,7 @@ class Admin extends Backend
|
|
|
$adminValidate->rule([
|
|
|
'username' => 'require|regex:\w{3,30}|unique:admin,username,' . $row->id,
|
|
|
'email' => 'require|email|unique:admin,email,' . $row->id,
|
|
|
- 'mobile' => 'regex:1[3-9]\d{9}|unique:admin,mobile,' . $row->id,
|
|
|
+ 'mobile' => 'regex:1[3-9]\d{9}|unique:admin,mobile,' . $row->id,
|
|
|
'password' => 'regex:\S{32}',
|
|
|
]);
|
|
|
$result = $row->validate('Admin.edit')->save($params);
|