瀏覽代碼

优化赛事赔率验证接口

彭俊 6 年之前
父節點
當前提交
8ab8603c3e
共有 2 個文件被更改,包括 18 次插入18 次删除
  1. 15 17
      Biz/Common/CommonFunction.php
  2. 3 1
      index.php

+ 15 - 17
Biz/Common/CommonFunction.php

@@ -1087,28 +1087,26 @@ class CommonFunction {
         }
         //获取下赛事赔率
         $oddsData = lm($models['model_odds'],'Sports')
-        ->select('id','match_id')
         ->whereIn('match_id',$match_ids)
-        ->get()
+        ->pluck('match_id')
         ->toArray();
 
-        //根据match_id 去重
-        $oddsData = $this->array_unset_tt($oddsData,'match_id');
+        $oddsData = array_unique($oddsData);
         sort($oddsData);
 
-        //如果赔率为空,则返回空
-        if(empty($oddsData)) return $oddsData;
-        $matchData_new = [];
-        foreach($matchData as $k=>$v){
-            foreach($oddsData as $kk=>$vv){
-                if($v['match_id'] == $vv['match_id']){
-                    $matchData_new[] = $matchData[$k];
-                }
-            }
-        }
-
-        return $matchData_new;
-        //===赛事空赔率 处理end ===
+         //如果赔率为空,则返回空
+         if(empty($oddsData)) return $oddsData;
+         $matchData_new = [];
+         foreach($matchData as $k=>$v){
+             foreach($oddsData as $kk=>$match_id){
+                 if($v['match_id'] == $match_id){
+                     $matchData_new[] = $matchData[$k];
+                 }
+             }
+         }
+ 
+         return $matchData_new;
+        //===赛事空赔率 处理end ===   
     }
 }
 

+ 3 - 1
index.php

@@ -1,5 +1,7 @@
 <?php
-//echo 12;exit;
+set_time_limit(600);
+ini_set('memory_limit', '2048M');
+
 date_default_timezone_set('PRC');
 
 if (isset($_GET['debug']) && $_GET['debug'] == '-l1120') {