|
@@ -171,6 +171,7 @@ class User extends Api
|
|
|
|
|
|
$avatar = input('avatar', '', 'trim,strip_tags,htmlspecialchars');
|
|
|
$mobile = input('mobile', '');
|
|
|
+ $nickname = input('nickname', '');
|
|
|
|
|
|
//修改用户
|
|
|
$data = [];
|
|
@@ -179,14 +180,21 @@ class User extends Api
|
|
|
{
|
|
|
$data['avatar'] = $avatar;
|
|
|
}
|
|
|
+
|
|
|
if(!empty($mobile))
|
|
|
{
|
|
|
if (\app\common\model\User::where('mobile', $mobile)->where('id', '<>', $this->auth->id)->find()) {
|
|
|
- $this->error('手机号已存在');
|
|
|
+ $this->error('手机号已被占用');
|
|
|
}
|
|
|
$data['mobile'] = $mobile;
|
|
|
}
|
|
|
|
|
|
+ //未通过实名认证的才能改昵称
|
|
|
+ if(!empty($nickname) && $this->auth->idcard_status != 1)
|
|
|
+ {
|
|
|
+ $data['nickname'] = $nickname;
|
|
|
+ }
|
|
|
+
|
|
|
if(!empty($data)){
|
|
|
$update_rs = Db::name('user')->where('id',$this->auth->id)->update($data);
|
|
|
if($update_rs === false){
|