Browse Source

调整滚球查询条件

彭俊 6 years ago
parent
commit
c72b0966c0
2 changed files with 8 additions and 10 deletions
  1. 5 2
      Application/Sports/Controller/MatchListWeb.php
  2. 3 8
      Biz/Common/CommonFunction.php

+ 5 - 2
Application/Sports/Controller/MatchListWeb.php

@@ -181,7 +181,7 @@ class MatchListWeb extends Controller{
         $model_match = $models['model_match'];
         //赛事数据
         if(!empty($lg_ids)){
-            $matchNum = lm($models['model_league'],"Sports")
+            $matchData = lm($models['model_league'],"Sports")
                 ->join($model_match,$model_match.'.lg_id',$models['model_league'].'.id')
                 ->select($select)
                 ->where($where)//状态条件
@@ -195,7 +195,7 @@ class MatchListWeb extends Controller{
                 })
                 ->get()->toArray();
         }else{
-            $matchNum = lm($models['model_league'],"Sports")
+            $matchData = lm($models['model_league'],"Sports")
                 ->join($model_match,$model_match.'.lg_id',$models['model_league'].'.id')
                 ->select($select)
                 ->where($where)//状态条件
@@ -209,6 +209,9 @@ class MatchListWeb extends Controller{
                 ->get()->toArray();
         }
 
+         //===获取当前赛事是否有赔率,如果没有则去除===
+         $matchNum = $this->commonFunction->Handle_Odds_Null($matchData,$models);
+
         if(empty($matchNum)) return $matchNum;
         //获取赛事id/联赛id
         $match_ids = [];

+ 3 - 8
Biz/Common/CommonFunction.php

@@ -721,13 +721,11 @@ class CommonFunction {
             switch ($type_code){
                 case 'StRollBall'://滚球 正在进行
                     $where = [
+                        // ['is_rollball','=',1],
                         ['status','<','2'],
-                        ['is_rollball','=',1],
-                        /*
                         ['match_date','=',date("Y-m-d")],
                         ['match_time','>',date("H:i:s", time()-(90*60))],
                         ['match_time','<',date("H:i:s", time())]
-                        */
                     ];
                     break;
                 case 'StSoon'://即将 今日两小时内开始
@@ -791,14 +789,11 @@ class CommonFunction {
             switch ($type_code){
                 case 'StRollBall'://滚球 正在进行
                     $where = [
-                        [$model_match.'.is_rollball','=',1],
+                        // [$model_match.'.is_rollball','=',1],
                         [$model_match.'.status','<','2'],
-                        /*
-                        [$model_match.'.status','>','0'],
                         [$model_match.'.match_date','=',date("Y-m-d")],
                         [$model_match.'.match_time','>',date("H:i:s", time()-(90*60))],
-                        [$model_match.'.match_time','<',date("H:i:s", time())]
-                        */
+                        [$model_match.'.match_time','<',date("H:i:s", time())]  
                     ];
                     break;
                 case 'StSoon'://即将 今日两小时内开始