gq 7 years ago
parent
commit
06c46312f0

+ 8 - 7
server/app/Http/Controllers/Api/V1/AuthController.php

xqd
@@ -300,19 +300,20 @@ class AuthController extends Controller
         Cache::store('file')->put($key, $verify_code, $this->expireTime);
         $msg = '【喵喵】您的验证码是:(' . $verify_code.')。5分钟内有效请及时验证';
 
-         $result = $this->sendSms($msg, $phone);
+        if(env("APP_DEBUG")){
+            $result = $this->sendSms($msg, $phone);
+        }else{
+            //product
+            return $this->api(['verify_code' => $verify_code]);
+        }
+//         $result = $this->sendSms($msg, $phone);
         /*if (!$result)
              $this->logger->Error("Send sms failed.");*/
         if ($result!='success') {
             \Log::error("Send sms failed.");
         }
 
-        if(env("APP_DEBUG")){
-            return $this->error(1);
-        }else{
-            //product
-            return $this->api(['verify_code' => $verify_code]);
-        }
+
 //        return $this->api(['verify_code' => $verify_code]);
     }
 

+ 2 - 2
server/app/Http/Controllers/Api/V1/IndexController.php

xqd xqd xqd
@@ -111,7 +111,7 @@ class IndexController extends Controller
         $login_user = $this->getUser();
         $id = $login_user->id;
 //        访问首页时 当用户的梦想结束时通知用户
-        $this->systemInfo($id);
+//        $this->systemInfo($id);
 
         $arr1 =DreamInfoModel::orderBy('score','desc')->limit(30)->select('id')->get()->toArray();
         $id_arr1 = array_column($arr1,'id');
@@ -165,6 +165,7 @@ class IndexController extends Controller
                     'attr_id'=>6,
 
                 ];
+                SystemInfoModel::firstOrCreate($arr);
 //                给支持者发送消息
                 $support_dream = SupportDreamModel::where('dream_id',$item->id)->get();
                 $top = [] ;
@@ -207,7 +208,6 @@ class IndexController extends Controller
                     }
                     SystemInfoModel::firstOrCreate($arr2);
                 }
-                SystemInfoModel::firstOrCreate($arr);
             }
 //            2   我关注的梦想倒计时 通知消息
             $dreams = UserCareDream::where('user_id',$id)->with('dreams')->get();