彭俊 6 éve
szülő
commit
a5e54bba40

+ 6 - 7
Application/Sports/Controller/MatchListWeb.php

@@ -165,7 +165,7 @@ class MatchListWeb extends Controller{
     public function getMatchData($type,$game_code,$p_code='',$time='',$lg_ids=[],$search=''){
         //$p_code 获取具体玩法下的赛事数据
         $models = $this->commonFunction->getModels($game_code,1);
-        $where = $this->commonFunction->getState($type,$models['model_match'],$game_code);
+        $where = $this->commonFunction->getState($type,$models['model_match'],$game_code, $p_code);
 
         $select = [$models['model_match'].'.id as match_id',$models['model_match'].'.lg_id'];
         $timeWhere = [];
@@ -290,7 +290,7 @@ where a.match_id = b.match_id and a.id = b.id ";
         }
 
         //赔率数据
-        $oddsCodeNum = $this->getOddsData($game_code,$models,$match_ids,$lg_ids,$p_code,$type);
+        $oddsCodeNum = $this->getOddsData($game_code,$models['model_odds'],$match_ids,$lg_ids,$p_code,$type);
 
         if(empty($p_code) and $type != 'StRollBall') {
             return $oddsCodeNum;
@@ -537,8 +537,8 @@ where a.match_id = b.match_id and a.id = b.id ";
     /*
      * 根据match_id获取赔率数据
      */
-    public function getOddsData($game_code,$models,$match_ids=[],$lg_ids=[],$p_code='',$type='', $matchData = []){
-        $model_odds = $models['model_odds'];
+    public function getOddsData($game_code,$model_odds,$match_ids=[],$lg_ids=[],$p_code='',$type='', $matchData = []){
+
         //获取pc版各球类滚球/让球玩法代码
         $get_DefaultOdds = require "Config/DefaultOdds.php";
         $DefaultOddsRoll = $get_DefaultOdds['PC_StRollBall'];//滚球
@@ -630,13 +630,12 @@ where a.match_id = b.match_id and a.id = b.id ";
         ];
         $select = ['match_id','type'];
 
-        $oddsData_gj_num = $this->commonFunction->Handle_Odds_Null_lg($matchData,$models);
-        /*$oddsData_gj_num = lm($model_odds,"Sports")
+        $oddsData_gj_num = lm($model_odds,"Sports")
             // ->select($select)
             ->where($where)
             ->groupby("lg_id","match_id","type")
             ->pluck('lg_id')
-            ->toArray();*/
+            ->toArray();
 
 
         // 去重 获取每个玩法下的赛事数量

+ 52 - 33
Biz/Common/CommonFunction.php

@@ -723,7 +723,7 @@ class CommonFunction {
      * @throws \Exception
      * 获取不同状态下的 查询条件
      */
-    function getState($type_code,$model_match = '',$game_code){
+    function getState($type_code,$model_match = '',$game_code, $p_code){
         if($model_match == ''){
             switch ($type_code){
                 case 'StRollBall'://滚球 正在进行
@@ -876,27 +876,40 @@ class CommonFunction {
                    
                     break;
                 case 'StSoon'://即将 今日两小时内开始
-                    $where = [
-                        [$model_match.'.status','=','0'],
-                        [$model_match.'.match_date','=',date("Y-m-d")],
-                        [$model_match.'.match_time','<',date("H:i:s", strtotime("+2 hour"))],
-                        [$model_match.'.match_time','>',date("H:i:s", time())]
-                        /*
-                        [$model_match.'.utime','>',date("Y-m-d").' 00:00:00']
-                        */
-                    ];
+                    if($p_code == 'kemp'){
+                        $where = [
+                            [$model_match.'.status','<','2']
+                        ];
+                    }else{
+                        $where = [
+                            [$model_match.'.status','=','0'],
+                            [$model_match.'.match_date','=',date("Y-m-d")],
+                            [$model_match.'.match_time','<',date("H:i:s", strtotime("+2 hour"))],
+                            [$model_match.'.match_time','>',date("H:i:s", time())]
+                            /*
+                            [$model_match.'.utime','>',date("Y-m-d").' 00:00:00']
+                            */
+                        ];
+                    }
                     break;
                 case 'StToday'://今日 今日未开始未结束
-                    $where = [
-                        [$model_match.'.status', '<', '2'],
-                        [$model_match.'.match_date','=',date("Y-m-d")],
-                        [$model_match.'.match_time','>',date("H:i:s", time())],
-                        /*
-                        [$model_match.'.utime','>',date("Y-m-d").' 00:00:00'],
-                        [$model_match.'.is_today','=',1],
-                        [$model_match.'.type', '=', '1'],
-                        */
-                    ];
+                    if($p_code == 'kemp'){
+                        $where = [
+                            [$model_match.'.status', '<', '2'],
+                        ];
+                    }else{
+                        $where = [
+                            [$model_match.'.status', '<', '2'],
+                            [$model_match.'.match_date','=',date("Y-m-d")],
+                            [$model_match.'.match_time','>',date("H:i:s", time())],
+                            /*
+                            [$model_match.'.utime','>',date("Y-m-d").' 00:00:00'],
+                            [$model_match.'.is_today','=',1],
+                            [$model_match.'.type', '=', '1'],
+                            */
+                        ];
+                    }
+
                     break;
                 case 'all'://所有赛事
                     $where = [
@@ -904,19 +917,25 @@ class CommonFunction {
                     ];
                     break;
                 case 'StMorningPlate'://早盘
-                    //获取当天结束的时间戳
-                    $endTime = mktime(0,0,0,date('m'),date('d')+1,date('Y'))-1;
-                    $where = [
-                        [$model_match.'.status', '<', '2'],
-                        // [$model_match.'.is_morningplate','=',1],
-                        [$model_match.'.us_time','>',$this->qgmdate('Y-m-d H:i:s',$endTime , -4)],
-                        /*
-                        [$model_match.'.match_date','>',date("Y-m-d",time())],
-                        [$model_match.'.match_time','>',date("H:i:s", time())],
-                        [$model_match.'.type', '=', '2'],
-                        [$model_match.'.utime','>',date("Y-m-d").' 00:00:00']
-                        */
-                    ];
+                     if($p_code == 'kemp'){
+                         $where = [
+                             [$model_match.'.status', '<', '2']
+                         ];
+                     }else{
+                         //获取当天结束的时间戳
+                         $endTime = mktime(0,0,0,date('m'),date('d')+1,date('Y'))-1;
+                         $where = [
+                             [$model_match.'.status', '<', '2'],
+                             // [$model_match.'.is_morningplate','=',1],
+                             [$model_match.'.us_time','>',$this->qgmdate('Y-m-d H:i:s',$endTime , -4)],
+                             /*
+                             [$model_match.'.match_date','>',date("Y-m-d",time())],
+                             [$model_match.'.match_time','>',date("H:i:s", time())],
+                             [$model_match.'.type', '=', '2'],
+                             [$model_match.'.utime','>',date("Y-m-d").' 00:00:00']
+                             */
+                         ];
+                     }
                     break;
                 case 'StStringScene'://串场 查询串场状态为1 开赛时间大于当前时间
                     $where = [