|
@@ -64,11 +64,12 @@ class UserCompanyBasic extends BaseController
|
|
|
//注册
|
|
|
public function add()
|
|
|
{
|
|
|
- $post = $this->request->only(['nickname' => '', 'mobile' => '', 'email' => '', 'companyArr' => []], 'post', 'trim');
|
|
|
+ $post = $this->request->only(['nickname' => '', 'mobile' => '', 'email' => '', 'level' => 2, 'companyArr' => []], 'post', 'trim');
|
|
|
$validate = Validate::rule([
|
|
|
'nickname|真实姓名' => 'require|min:2|max:200',
|
|
|
'mobile|手机号' => 'require|number|length:11|mobile',
|
|
|
'email|邮箱' => 'email',
|
|
|
+ 'level|账号等级' => 'number|in:1,2',
|
|
|
'companyArr|关联业务公司' => 'require|array|max:100',
|
|
|
]);
|
|
|
if ($validate->check($post) == false) return json_show(1004, $validate->getError());
|
|
@@ -89,9 +90,10 @@ class UserCompanyBasic extends BaseController
|
|
|
'username' => $post['mobile'],
|
|
|
'password' => $password,
|
|
|
'salt' => $salt,
|
|
|
+ 'status' => 1,
|
|
|
'mobile' => $post['mobile'],
|
|
|
+ 'level' => $post['level'],
|
|
|
'source' => 'paltadd',
|
|
|
- 'status' => 1,
|
|
|
'addtime' => $date,
|
|
|
'updatetime' => $date
|
|
|
];
|