修复:登录有问题

This commit is contained in:
wuhui_zzw 2023-03-21 13:55:35 +08:00
parent fde45653c9
commit 6638a77051
1 changed files with 4 additions and 2 deletions

View File

@ -129,12 +129,14 @@ class Login extends BaseModel{
// 承诺登录(需要同意承诺书后方可登录)
public function promiseLogin($data){
$data['wx_unionid'] = $data['wx_unionid'] ?? '';
// 获取用户信息
$info = (array)Db::name('member')
->field('member_id,username, nickname, mobile, email, status, last_login_time, can_receive_registergift')
->where(function($query) use ($data){
$query->where('weapp_openid',$data['weapp_openid'])
->whereOr('wx_unionid',$data['wx_unionid'] ?? '');
if($data['weapp_openid'] && $data['wx_unionid']) $query->where('weapp_openid',$data['weapp_openid'])->whereOr('wx_unionid',$data['wx_unionid']);
else if($data['weapp_openid']) $query->where('weapp_openid',$data['weapp_openid']);
else if($data['wx_unionid']) $query->where('wx_unionid',$data['wx_unionid']);
})
->where('site_id',$data['site_id'])
->where('is_delete',0)