|
|
|
@ -108,7 +108,10 @@ class LoginService extends BaseService |
|
|
|
public function userLogin($phone, $openid, $unionid) |
|
|
|
{ |
|
|
|
$field = 'id,openid,phone,nickname,sex,headimgurl'; |
|
|
|
$user = WechatUser::where('phone', $phone)->where('openid', $openid)->where('delete_time', 0)->field($field)->find(); |
|
|
|
$user = WechatUser::where('phone', $phone)->where('delete_time', 0)->field($field)->find(); |
|
|
|
if ($openid != $user->openid) { |
|
|
|
WechatUser::where('id', $user->id)->save(['openid' => $user->openid]); |
|
|
|
} |
|
|
|
if ($user) { |
|
|
|
return $this->userSuccess($user); |
|
|
|
} |
|
|
|
|