|
@@ -142,12 +142,14 @@ class Auth
|
|
|
}
|
|
|
Db::startTrans();
|
|
|
$find=User::onlyTrashed()->type($extend['type']);
|
|
|
- if($mobile){
|
|
|
- $find->where('mobile', $mobile);
|
|
|
- }
|
|
|
- if(!empty($extend['openid'])){
|
|
|
- $find->where('openid',$extend['openid']);
|
|
|
- }
|
|
|
+ $find->where(function (Query $query)use ($mobile,$extend){
|
|
|
+ if($mobile){
|
|
|
+ $query->where('mobile', $mobile);
|
|
|
+ }
|
|
|
+ if(!empty($extend['openid'])){
|
|
|
+ $query->whereOr('openid',$extend['openid']);
|
|
|
+ }
|
|
|
+ });
|
|
|
$user=$find->find();
|
|
|
if (!$user){
|
|
|
$ip = request()->ip();
|