彭俊 6 роки тому
батько
коміт
2d4f87bd7b

+ 4 - 0
Application/Sports/Controller/MatchList.php

@@ -522,10 +522,14 @@ class  MatchList extends Controller {
             }else{
                 $where[] = ['is_stringscene','=',0];
             }
+            //根据球类追加获取限定玩法
+            $p_code =  $this->commonFunction->getOddsPcode($game_code);
+
             $oddsData = lm($model_odds, 'Sports')
                 ->select('sort','p_code','id','odds_only','odds_code',$model_odds.'.status','odds','condition','sort','source','utime')
                 ->where([$model_odds.'.match_id'=>$matchID,$model_odds.'.type'=>0])
                 ->where($where)
+                ->whereIn('p_code',$p_code)
                 ->orderBy('sort', 'desc')
                 ->orderBy('p_code','desc')
                 ->orderBy('odds_code','desc')

+ 22 - 1
Biz/Common/CommonFunction.php

@@ -1350,7 +1350,28 @@ class CommonFunction {
 			strtoupper(dechex(date('m'))).date('d').
 			substr(time(),-5).substr(microtime(),2,5).sprintf('d',rand(0,99));
 		return $order_sn;
-	}
+    }
+    
+    //根据球类追加限定玩法
+    function getOddsPcode($game_code = 'zq'){
+
+        $p_code = [];
+
+        if($game_code == 'zq'){
+            $p_code = ['C','B','TG','CB','TB','GS','CO','TS'];
+        }
+        if($game_code == 'lq'){
+            $p_code = ['LN','C','TN','TS','TB','CO'];
+        }
+        if($game_code == 'wq'){
+            $p_code = ['LB','TN','TS','B','LD','C'];
+        }
+        if($game_code == 'bq'){
+            $p_code = ['CO','C','TN','TS'];
+        }
+
+        return $p_code;
+    }
 }
 
 ?>