作者 anyv
1 个管道 的构建 通过 耗费 0 秒

4

@@ -37,7 +37,7 @@ class IndexController extends HomeBaseController @@ -37,7 +37,7 @@ class IndexController extends HomeBaseController
37 ->where('app_id', $appId) 37 ->where('app_id', $appId)
38 ->find(); 38 ->find();
39 if ($findThirdPartyUser) { 39 if ($findThirdPartyUser) {
40 - $this->wechatUserLogin($findThirdPartyUser,$openid,$appId); 40 + $this->wechatUserLogin($wechat_user,$findThirdPartyUser,$openid,$appId);
41 }else{ 41 }else{
42 $this->wechatUserRegister($wechat_user,$openid,$appId); 42 $this->wechatUserRegister($wechat_user,$openid,$appId);
43 } 43 }
@@ -57,14 +57,15 @@ class IndexController extends HomeBaseController @@ -57,14 +57,15 @@ class IndexController extends HomeBaseController
57 * @param $openid 57 * @param $openid
58 * @param $appId 58 * @param $appId
59 */ 59 */
60 - protected function wechatUserLogin($findThirdPartyUser,$openid,$appId){ 60 + protected function wechatUserLogin($wechat_user,$findThirdPartyUser,$openid,$appId){
61 $currentTime = time(); 61 $currentTime = time();
62 $ip = $this->request->ip(0, true); 62 $ip = $this->request->ip(0, true);
63 $token = cmf_generate_user_token($findThirdPartyUser['user_id'], 'public'); 63 $token = cmf_generate_user_token($findThirdPartyUser['user_id'], 'public');
64 $userData = [ 64 $userData = [
65 'last_login_ip' => $ip, 65 'last_login_ip' => $ip,
66 'last_login_time' => $currentTime, 66 'last_login_time' => $currentTime,
67 - 'login_times' => ['exp', 'login_times+1'] 67 + 'login_times' => ['exp', 'login_times+1'],
  68 + 'user_nickname' => $wechat_user['nickname']
68 ]; 69 ];
69 $row1=Db::name("third_party_user") 70 $row1=Db::name("third_party_user")
70 ->where('openid', $openid) 71 ->where('openid', $openid)