|
|
@@ -24,7 +24,12 @@ class UserBehavior
|
|
|
if(isset($wechatInfo['unionid']) && $wechatInfo['unionid'] != '' && WechatUser::be(['unionid'=>$wechatInfo['unionid']])){
|
|
|
WechatUser::edit($wechatInfo,$wechatInfo['unionid'],'unionid');
|
|
|
$uid = WechatUser::where('unionid',$wechatInfo['unionid'])->value('uid');
|
|
|
- User::updateWechatUser($wechatInfo,$uid);
|
|
|
+ if(!User::be(['uid'=>$uid])){
|
|
|
+ $wechatInfo = WechatUser::where('uid',$uid)->find();
|
|
|
+ User::setWechatUser($wechatInfo);
|
|
|
+ }else{
|
|
|
+ User::updateWechatUser($wechatInfo,$uid);
|
|
|
+ }
|
|
|
}else if(WechatUser::be(['openid'=>$wechatInfo['openid']])){
|
|
|
WechatUser::edit($wechatInfo,$wechatInfo['openid'],'openid');
|
|
|
User::updateWechatUser($wechatInfo,WechatUser::openidToUid($wechatInfo['openid']));
|