xiaogang 4 years ago
parent
commit
9a397de337
1 changed files with 3 additions and 1 deletions
  1. 3 1
      app/Http/Controllers/Api/AuthorizationsController.php

+ 3 - 1
app/Http/Controllers/Api/AuthorizationsController.php

xqd
@@ -55,10 +55,12 @@ class AuthorizationsController extends Controller
 //            abort(403, '短信校验失败');
 //        }
 
-        $user = User::firstOrCreate([
+        User::firstOrCreate([
             'mobile' => $request->input('mobile'),
         ]);
 
+        $user = User::query()->where(['mobile'=>$request->input('mobile')])->first();
+
         if (!$user->ycode) {
             $user->ycode = $this->create_code();
         }