Tree преди 1 ден
родител
ревизия
02ee3bb289
променени са 2 файла, в които са добавени 19 реда и са изтрити 12 реда
  1. 9 7
      app/Http/Controllers/Game/PayRechargeController.php
  2. 10 5
      app/Http/Controllers/Game/WebRouteController.php

+ 9 - 7
app/Http/Controllers/Game/PayRechargeController.php

@@ -1176,7 +1176,14 @@ class PayRechargeController extends Controller
         // 需要 >= 3 天,即最后一次充值至少是3天前
         $inactiveDays = max(0, (int)$diffDays - 1);
 
-        if ($inactiveDays < 3) {
+        // 5. 查询最近一条 7 日礼包记录状态(用于判断是否进入新一轮)
+        $record = DB::table('agent.dbo.inactive_vip_gift_records')
+            ->where('user_id', $userId)
+            ->where('gift_id', 305)
+            ->orderBy('id', 'desc')
+            ->first();
+
+        if ($inactiveDays < 3 && !$record) {
             // 不满足条件:连续未充值天数不足
             return apiReturnSuc([
                 'status' => 0,
@@ -1219,12 +1226,7 @@ class PayRechargeController extends Controller
             }
         }
 
-        // 5. 查询最近一条 7 日礼包记录状态(用于判断是否进入新一轮)
-        $record = DB::table('agent.dbo.inactive_vip_gift_records')
-            ->where('user_id', $userId)
-            ->where('gift_id', 305)
-            ->orderBy('id', 'desc')
-            ->first();
+
 
         /*
          * status 定义:

+ 10 - 5
app/Http/Controllers/Game/WebRouteController.php

@@ -476,13 +476,18 @@ class WebRouteController extends Controller
                 $candidates = $query->orderBy('CreateTime', 'desc')->get();
                 $obj = ApkService::pickBestCandidate($candidates, $fbclid);
             }
-            if(!$obj && !empty($fbclid)){
-                $obj = DB::table($table)
-                    ->where('Cookie', 'like', '%' . $fbclid . '%')
-                    ->orderBy('CreateTime', 'desc')
-                    ->first();
+            try {
+                if(!$obj && !empty($fbclid)){
+                    $obj = DB::table($table)
+                        ->where('Cookie', 'like', '%' . $fbclid . '%')
+                        ->orderBy('CreateTime', 'desc')
+                        ->first();
+                }
+            }catch (\Exception $e) {
+                $obj = null;
             }
 
+
             if($obj){
                 $data=['type'=>$obj->Platform,'cookie'=>$obj->Cookie,'s_k'=>$obj->SPE_KEY, 'url_sign'=>$obj->UrlSign, 'params'=>$obj->Params, 'ff'=>$obj->FF, 'localStorage'=>$obj->LocalStorage];
             }