彭俊 6 роки тому
батько
коміт
cbc92995ba
2 змінених файлів з 13 додано та 24 видалено
  1. 0 17
      Application/Sports/Controller/Css.php
  2. 13 7
      Biz/Match/GetmatchData.php

+ 0 - 17
Application/Sports/Controller/Css.php

@@ -33,23 +33,6 @@ class  Css extends Controller {
         Render($data, '1', lang('Tips','Sports')->get('success'));
     }
 
-    //获取毫秒级时间
-    public function getMsecToMescdate($msectime)
-    {
-        $msectime = $msectime * 0.001;
-        if(strstr($msectime,'.')){
-            sprintf("%01.3f",$msectime);
-            list($usec, $sec) = explode(".",$msectime);
-            $sec = str_pad($sec,3,"0",STR_PAD_RIGHT);
-        }else{
-            $usec = $msectime;
-            $sec = "000";
-        }
-        $date = date("Y-m-d H:i:s.x",$usec);
-        $mescdate = str_replace('x', $sec, $date);
-        return $mescdate;
-    }
-
     /**
      * 年月日、时分秒 + 3位毫秒数
      * @param string $format

+ 13 - 7
Biz/Match/GetmatchData.php

@@ -65,7 +65,9 @@ class GetmatchData {
             case 'StMorningPlate'://早盘
                 //默认当天
                 if(empty($ret['match_date'])){
-                    $match_date = date("Y-m-d");
+                    // $match_date = date("Y-m-d");
+                    $match_date = '';
+
                 }else{
                     if($ret['match_date'] != 'other'){
                         $match_date = $ret['match_date'];
@@ -76,7 +78,7 @@ class GetmatchData {
                 $oddsTypeWhere = [
                     [$models['model_odds'].'.is_morningplate','=',1],
                 ];
-                $data = $this->getMorningPlate($source,$models,$where,$lg_id,$search,$match_date,$oddsTypeWhere);
+                $data = $this->getMorningPlate($source,$models,$where,$lg_id,$search,$match_date,$oddsTypeWhere,$ret['type_code'],$ret['game_code']);
                 break;
             case 'StStringScene'://串场
                 $oddsTypeWhere = [
@@ -382,7 +384,7 @@ class GetmatchData {
     /**
      * 获取早盘数据
      */
-    public function getMorningPlate($source,$models,$where,$lg_id=0,$search='',$time='',$oddsTypeWhere=''){
+    public function getMorningPlate($source,$models,$where,$lg_id=0,$search='',$time='',$oddsTypeWhere='',$type_code='',$game_code=''){
         //获取model
         $model_match = $models['model_match'];
         $model_odds = $models['model_odds'];
@@ -395,7 +397,7 @@ class GetmatchData {
             return $leagueData;
         }
 
-        $data = $this->getMatch($source,$models,$search,$where,$time);
+        $data = $this->getMatch($source,$models,$search,$where,$time,'',$type_code,$game_code);
         return $data;
     }
 
@@ -466,7 +468,7 @@ class GetmatchData {
     /**
      * 获取国家/洲 下联赛
      */
-    public function getMatch($source,$models,$search,$where,$time='',$type_code=''){
+    public function getMatch($source,$models,$search,$where,$time='',$type_code='',$s_type_code='',$game_code=''){
         //国家下所有联赛
         $country = lm($models['model_league'],"Sports")
             ->leftjoin('st_area_country','st_area_country.id',$models['model_league'].'.country_id')
@@ -488,7 +490,7 @@ class GetmatchData {
             ->toArray();
 
         if($type_code != 'StChampion'){//非冠军赛事
-            $data = $this->getMatchNum($source,$country,$area,$models,$where,$search,$time);
+            $data = $this->getMatchNum($source,$country,$area,$models,$where,$search,$time,'',$s_type_code,$game_code);
         }else{//冠军赛事
             $data = $this->getMatchStChampionNum($source,$country,$area,$models,$where,$search,$time);
         }
@@ -500,7 +502,7 @@ class GetmatchData {
      * 获取联赛下赛事 数量
      * 非冠军盘口
      */
-    public function getMatchNum($source,$country,$area,$models,$where,$search,$time='',$type=0){
+    public function getMatchNum($source,$country,$area,$models,$where,$search,$time='',$type=0,$s_type_code='',$game_code=''){
         $leagueData = lm($models['model_league'],'Sports')
             ->select('id as lg_id','name_chinese as league','country_id','area_id')
             ->where([[$models['model_league'].'.name_chinese','!=','']])
@@ -517,6 +519,10 @@ class GetmatchData {
                 $timeWhere[] = ['match_date',$time];
             }
         }
+        if($s_type_code == 'StMorningPlate' and $game_code !='zq'){
+            $timeWhere[] = ['match_date','>',date('Y-m-d',time())];
+        }
+
         //获取赛事
         $matchData = lm($models['model_match'],'Sports')
             ->select('id as match_id','lg_id')