فهرست منبع

Merge branch 'master' of http://git.huxiukeji.com/lizhen/lanjingling

lizhen_gitee 1 سال پیش
والد
کامیت
07155accc0
1فایلهای تغییر یافته به همراه8 افزوده شده و 0 حذف شده
  1. 8 0
      application/api/controller/User.php

+ 8 - 0
application/api/controller/User.php

@@ -3,6 +3,7 @@
 namespace app\api\controller;
 
 use app\common\controller\Api;
+use app\common\library\Auth;
 use app\common\library\Ems;
 use app\common\library\Sms;
 use app\common\model\User as UserM;
@@ -610,6 +611,10 @@ class User extends Api
                 }
                 $user = UserM::where(['mobile'=>$mobile])->find();*/
                 if (empty($user)) {//微信登录注册
+                    if (empty($user['nickname'])) {
+                        $systemAuth = new Auth();
+                        $nickName = $systemAuth->get_rand_nick_name();
+                    }
                     $time = time();
                     $ip = request()->ip();
                     $userData = [
@@ -626,6 +631,9 @@ class User extends Api
                     if (!$userAdd) {
                         throw new Exception('注册失败');
                     }
+                    $userAppendData['username'] = 'u' . (10000 + $userAdd);
+                    $userWhere['id'] = $userAdd;
+                    Db::name('user')->where($userWhere)->update($userAppendData);
                     $user = Userm::getById($userAdd);
                 }