|
@@ -108,8 +108,8 @@ class WeiBanSync implements ShouldQueue
|
|
|
$oldExtUser = $External->query()->find($extUser['id'],['custom_uid']);
|
|
|
// 如果存在账号的话获取客户UID
|
|
|
if( $oldExtUser ) $extUser['custom_uid'] = ($oldExtUser->custom_uid);
|
|
|
- // 不存在账号又存在手机号,才创建账号
|
|
|
- if( !$extUser['custom_uid'] && $phone ) $extUser['custom_uid'] = $this->customHandle($phone,$extUser,$Custom);
|
|
|
+ // 存在手机号,才创建账号
|
|
|
+ if( $phone ) $extUser['custom_uid'] = $this->customHandle($phone,$extUser,$Custom);
|
|
|
// 新增或者修改
|
|
|
$External->query()->upsert($extUser,'id',['name','avatar','gender','type','corp_name','corp_full_name','status','custom_uid','update_time']);
|
|
|
}
|
|
@@ -152,7 +152,7 @@ class WeiBanSync implements ShouldQueue
|
|
|
// 是否已经注册
|
|
|
$custom = $Custom->getOneByPhone($phone);
|
|
|
// 如果已经注册
|
|
|
- $uid = $custom ? $custom['uid'] : $Custom->add(['phone'=>$phone,'username'=>$extUser['name'],'userpic'=>$extUser['avatar'],'sex'=>$extUser['gender'],'weiban_extid'=>$extUser['id']]);
|
|
|
+ $uid = $custom ? $Custom->edit($custom['uid'],['username'=>$extUser['name'],'userpic'=>$extUser['avatar'],'sex'=>$extUser['gender'],'weiban_extid'=>$extUser['id']]) : $Custom->add(['phone'=>$phone,'username'=>$extUser['name'],'userpic'=>$extUser['avatar'],'sex'=>$extUser['gender'],'weiban_extid'=>$extUser['id']]);
|
|
|
// 成功,赋值
|
|
|
return $uid;
|
|
|
}
|