xiaogang 4 vuotta sitten
vanhempi
commit
7cfe123bca
1 muutettua tiedostoa jossa 2 lisäystä ja 2 poistoa
  1. 2 2
      app/Http/Controllers/Api/AuthorizationsController.php

+ 2 - 2
app/Http/Controllers/Api/AuthorizationsController.php

xqd xqd
@@ -115,7 +115,7 @@ class AuthorizationsController extends Controller
     //登录操作
     public function do_login($mobile,$password=null){
         if(!empty($password)){
-            if (!$user=User::where(['mobile' => $mobile])->first()) {
+            if (!$user=User::query()->where(['mobile' => $mobile])->whereNull('deleted_at')->first()) {
                 throw new Exception("用户不存在");
             }
             $credentials = ['mobile'=>$mobile,'password'=>$password];
@@ -127,7 +127,7 @@ class AuthorizationsController extends Controller
             User::firstOrCreate([
                 'mobile' => $mobile,
             ]);
-            $user = User::query()->where(['mobile'=>$mobile])->first();
+            $user = User::query()->where(['mobile'=>$mobile])->whereNull('deleted_at')->first();
         }
 
         if (!$user->ycode) {