微信小程序登录绑定相关
This commit is contained in:
parent
1c622039c0
commit
2e64e690ac
@ -78,7 +78,10 @@ class LoginController extends BaseApiController
|
||||
public function updateUser()
|
||||
{
|
||||
$params = (new WechatLoginValidate())->post()->goCheck("updateUser");
|
||||
LoginLogic::updateUser($params, $this->userId);
|
||||
$result = LoginLogic::updateUser($params, $this->userId);
|
||||
if ($result === false) {
|
||||
return $this->fail(LoginLogic::getError());
|
||||
}
|
||||
return $this->success('操作成功', [], 1, 1);
|
||||
}
|
||||
|
||||
|
@ -435,7 +435,7 @@ class LoginLogic extends BaseLogic
|
||||
* @notes 更新用户信息
|
||||
* @param $params
|
||||
* @param $userId
|
||||
* @return User
|
||||
* @return User|bool
|
||||
* @author 段誉
|
||||
* @date 2023/2/22 11:19
|
||||
*/
|
||||
@ -443,12 +443,12 @@ class LoginLogic extends BaseLogic
|
||||
{
|
||||
$find=User::where(['mobile' =>$params['mobile']])->find();
|
||||
if($find){
|
||||
$auth=UserAuth::where('user_id',$find['id'])->find();
|
||||
$auth=UserAuth::where(['user_id'=>$find['id'],'terminal'=>1])->find();
|
||||
if($auth){
|
||||
self::$error ='该手机号已被绑定';
|
||||
return false;
|
||||
}else{
|
||||
UserAuth::where('user_id',$userId)->update(['user_id'=>$find['id']]);
|
||||
UserAuth::where(['user_id'=>$find['id'],'terminal'=>1])->update(['user_id'=>$find['id']]);
|
||||
}
|
||||
}
|
||||
$data=[
|
||||
|
@ -12,6 +12,7 @@ use app\common\{logic\BaseLogic,
|
||||
model\system_store\SystemStore,
|
||||
model\system_store\SystemStoreStaff,
|
||||
model\user\User,
|
||||
model\user\UserAuth,
|
||||
model\user\UserRecharge,
|
||||
model\user\UserShip,
|
||||
model\user_sign\UserSign,
|
||||
@ -103,7 +104,7 @@ class UserLogic extends BaseLogic
|
||||
$data['no_writeoff'] = StoreOrder::where([
|
||||
'is_writeoff'=>0,'uid'=>$uid
|
||||
])->whereIn('shipping_type',[1,2])->count();
|
||||
|
||||
$data['openid'] = UserAuth::where(['user_id'=>$uid,'terminal'=>1])->value('openid');
|
||||
}else{
|
||||
$data = [];
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user