Browse Source

代码整理

彭俊 6 years ago
parent
commit
39323e1a04

+ 5 - 21
Application/Sports/Controller/MatchList.php

@@ -89,7 +89,7 @@ class  MatchList extends Controller {
          $data['game_code'] = $typeGame;
          $data['type'] = lm('GameType','Sports')->where('game_code',$typeGame)->value('game_name');
          $st_competition = $getModels['model_match'];
-//       所有赛事
+         //所有赛事
          $where_search = [];
          $where = [];
          $Orwhere = [];
@@ -237,7 +237,7 @@ class  MatchList extends Controller {
         $gameType = $_REQUEST['gameType'];
         $search = $_REQUEST['search'];
         $date = $_REQUEST['datetime'];
-        //=获取球了MODEL
+        //获取球类 model
         $gameType = empty($gameType) ? 'zq':$gameType;
         $getModels = $this->commonFunction->getModels($gameType);
         $st_league = $getModels['model_league'];
@@ -496,11 +496,9 @@ class  MatchList extends Controller {
 
 
             //取消按状态查询赔率数据
-            //$oddsTypeWhere = $this->getOddsTypeWhere($model_odds,$oddsType);
             $oddsData = lm($model_odds, 'Sports')
                 ->select('sort','p_code','id','odds_only','odds_code',$model_odds.'.status','odds','condition','sort','source','utime')
-//                ->where($this->source)
-                ->where([$model_odds.'.match_id'=>$matchID,$model_odds.'.type'=>0])//,$model_odds.'.expire_time'=>$utime
+                ->where([$model_odds.'.match_id'=>$matchID,$model_odds.'.type'=>0])
                 ->orderBy('sort', 'desc')
                 ->orderBy('p_code','desc')
                 ->orderBy('odds_code','desc')
@@ -509,7 +507,6 @@ class  MatchList extends Controller {
             $matchData = lm($model_match, 'Sports')
                 ->join($model_league,$model_league.'.id',$model_match.'.lg_id')
                 ->select($model_match.'.lg_id','name_chinese',$model_match.'.id as match_id','home_team','guest_team','match_date','match_time',$model_match.'.status')
-//                ->where($model_match.'.source',$this->source['source'])
                 ->where([$model_match.'.id'=>$matchID])
                 ->first();
 
@@ -520,12 +517,6 @@ class  MatchList extends Controller {
             $matchData->result_mark = '';//赛事实时数据json
             //如果该赛事正在进行,则获取进行时间
             if($matchData->status ==1){
-//                $result = lm($model_result, 'Sports')->select('match_id','match_time','match_score')
-////                    ->where($this->source)
-//                    ->where(['match_id'=>$matchData->match_id])
-//                    ->first();
-//                $matchData->ptime = $result->match_time;
-//                $matchData->match_score = $result->match_score;
                 $result_record = $models['model_result_record'];
                 $match_id = $matchData->match_id;
                 //如果是棒球
@@ -552,6 +543,7 @@ where a.match_id = b.match_id and a.id = b.id ";
                     $matchData->result_mark = $match_result_record[0]->result_mark;
 
                 }else{
+                    //其他球类
                     $sql = "select a.match_id,a.home_score,a.guest_score,a.match_time as a_time,a.match_process from $result_record a,
 (select match_id,max(id) id from $result_record where match_id = $match_id group by match_id)b
 where a.match_id = b.match_id and a.id = b.id ";
@@ -561,10 +553,7 @@ where a.match_id = b.match_id and a.id = b.id ";
                     $matchData->match_score = $match_result_record[0]->home_score.'-'.$match_result_record[0]->guest_score;
                     $matchData->result_mark = '';
                 }
-
                 $matchData->ptime = $match_result_record[0]->a_time;
-
-
             }
 
             //赛事已结束
@@ -715,8 +704,6 @@ where a.match_id = b.match_id and a.id = b.id ";
                 }
             }
         }
-
-
         Render($p_code, '1', lang('Tips','Sports')->get('success'));
     }
 
@@ -736,7 +723,6 @@ where a.match_id = b.match_id and a.id = b.id ";
      */
     public function updateOdds(){
         $data = $_REQUEST;
-//        $data = ['game_code'=>'zq','match_id'=>3095448];
 
         $getModels = $this->commonFunction->getModels($data['game_code']);
             $model_match = $getModels['model_match'];
@@ -747,10 +733,8 @@ where a.match_id = b.match_id and a.id = b.id ";
             $oddsData = lm($model_match,"Sports")
                 ->join($model_odds,$model_odds.'.match_id',$model_match.'.id')
                 ->select($model_match.'.id as match_id',$model_match.'.match_date',$model_match.'.home_team',$model_match.'.guest_team',$model_odds.'.id as odds_id',$model_odds.'.p_code',$model_odds.'.odds_code',$model_odds.'.condition',$model_odds.'.odds',$model_odds.'.odds_only',$model_odds.'.status',$model_odds.'.sort')
-//                ->where($model_match.'.source',$this->source)
                 ->where($model_odds.'.type',0)
                 ->where($where)
-//                ->where($model_odds.'.expire_time','>',date("Y-m-d H:i:s"))
                 ->get()->toArray();
 
         $p_code_array = [];
@@ -844,7 +828,7 @@ where a.match_id = b.match_id and a.id = b.id ";
      * @return [int]  $dataCount
      */
     public function getMatchCount($where=[],$Orwhere=[],$where_search=[],$game_code ='zq'){
-;        $getModels = $this->commonFunction->getModels($game_code);
+        $getModels = $this->commonFunction->getModels($game_code);
         $st_league = $getModels['model_league'];
         $st_competition = $getModels['model_match'];
 

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

@@ -28,7 +28,6 @@ class MatchListWeb extends Controller{
 
     //各球类玩法列表及数量
     public function gameList(){
-
         $type = $_REQUEST['type'];//必填 状态代码
         $game_code = $_REQUEST['game_code'];//球类代码
         $p_code = $_REQUEST['p_code'];//父级玩法代码
@@ -75,7 +74,9 @@ class MatchListWeb extends Controller{
         }
     }
 
-    //获取滚球
+    /*
+     * 获取滚球数据
+     */
     public function getRollBall($type,$game_code,$p_code='',$lg_ids=[],$search=''){
 
         //根据球类代码及玩法代码 获取相关赛事赔率数据
@@ -111,7 +112,10 @@ class MatchListWeb extends Controller{
 
         Render($gameData, '1', lang('Tips','Sports')->get('success'));
     }
-    //获取非滚球数据
+
+    /*
+     * 获取非滚球数据
+     */
     public function Other($type,$game_code,$p_code,$time='',$lg_ids=[],$search=''){
         //根据球类代码及玩法代码 获取相关赛事赔率数据
         if(!empty($game_code) and !empty($p_code)){
@@ -139,7 +143,9 @@ class MatchListWeb extends Controller{
         Render($matchDataNum, '1', lang('Tips','Sports')->get('success'));
     }
 
-    //获取赛事数据
+    /*
+     * 获取赛事数据
+     */
     public function getMatchData($type,$game_code,$p_code='',$time='',$lg_ids=[],$search=''){
         //$p_code 获取具体玩法下的赛事数据
         $models = $this->commonFunction->getModels($game_code,1);
@@ -224,6 +230,7 @@ where a.match_id = b.match_id and a.id = b.id ";
 (select match_id,max(id) id from $result_record where match_id IN ($match_ids_str) group by match_id)b
 where a.match_id = b.match_id and a.id = b.id ";
             }else{
+                //其他球类
                 $sql = "select a.match_id,a.home_score,a.guest_score,a.match_time as a_time,a.match_process from $result_record a,
 (select match_id,max(id) id from $result_record where match_id IN ($match_ids_str) group by match_id)b
 where a.match_id = b.match_id and a.id = b.id ";
@@ -265,7 +272,9 @@ where a.match_id = b.match_id and a.id = b.id ";
         return $data;
     }
 
-    //联赛/赛事/赔率 组装数据
+    /*
+     * 联赛/赛事/赔率 组装数据
+     */
     public function get_l_m_o($p_code='',$matchData=[],$oddsCodeNum=[],$model_result_record='',$game_code=''){
 
         $match_odds = [];
@@ -284,7 +293,6 @@ where a.match_id = b.match_id and a.id = b.id ";
                         $match_odds[$kk]['oddsData'][] = $v;
                     }
                 }
-
             }
             sort($match_odds);
 
@@ -483,7 +491,10 @@ where a.match_id = b.match_id and a.id = b.id ";
         $data = [$matchData,$leagueList];
         return $data;
     }
-    //根据match_id获取赔率数据
+
+    /*
+     * 根据match_id获取赔率数据
+     */
     public function getOddsData($game_code,$model_odds,$match_ids=[],$lg_ids=[],$p_code='',$type=''){
 
         $select = ['match_id','p_code'];

+ 8 - 5
Application/Sports/Model/St_zq_competition.php

@@ -4,9 +4,9 @@ namespace App\Sports\Model;
 use \System\Model;
 
 /**
- * Class Account
+ * Class St_zq_competition
  * @package App\Sports\Model
- * 用户账号
+ * 足球赛事
  */
 class St_zq_competition extends Model
 {
@@ -26,7 +26,9 @@ class St_zq_competition extends Model
         return $matchData;
     }
 
-    //获取各球类 滚球赛事关联赛事结果数据
+    /*
+     * 获取各球类 滚球赛事关联赛事结果数据
+     */
     public static function getRollMatchDataAll($source,$models,$where,$lg_ids=[]){
         $model_match = $models['model_match'];
         $model_result = $models['model_result'];
@@ -80,13 +82,14 @@ where a.match_id = b.match_id and a.id = b.id ";
         return $matchData;
     }
 
-    //获取各球类 非滚球赛事关联赛事结果数据
+    /*
+     * 获取各球类 非滚球赛事关联赛事结果数据
+     */
     public static function getSoonMatchDataAll($source,$models,$where,$lg_ids=[]){
         $model_match = $models['model_match'];
 
         $data = lm($model_match,"Sports")
             ->select($model_match.'.lg_id',$model_match.'.id as match_id',$model_match.'.tag','match_date',$model_match.'.match_time',$model_match.'.home_team',$model_match.'.guest_team',$model_match.'.us_time')
-//            ->where($source)
             ->where($where)
             ->whereIn($model_match.'.lg_id',$lg_ids)
             ->orderBy('match_time','asc')

+ 10 - 6
Application/Sports/Model/St_zq_league.php

@@ -6,14 +6,16 @@ use \System\Model;
 /**
  * Class Account
  * @package App\Sports\Model
- * 用户账号
+ * 足球联赛
  */
 class St_zq_league extends Model
 {
 
     protected $table = 'st_zq_league';
 
-    //获取滚球 联赛数据
+    /*
+     * 获取滚球 联赛数据
+     */
     public static function getRollLeagueData($source,$models,$where,$search=''){
         $model_match = $models['model_match'];
         $model_league = $models['model_league'];
@@ -21,7 +23,6 @@ class St_zq_league extends Model
         //当前状态下所有联赛
         $data = lm($model_league,"Sports")
             ->join($model_match,$model_match.'.lg_id',$model_league.'.id')
-//            ->join($model_result,$model_result.'.match_id',$model_match.'.id')
             ->select($model_league.'.id as lg_id',$model_league.'.name_chinese as leagueName')
             ->distinct($model_league.'.name_chinese')
             ->where([[$model_league.'.name_chinese','!=','']])
@@ -38,7 +39,9 @@ class St_zq_league extends Model
         return $data;
     }
 
-    //获取即将 联赛数据
+    /*
+     * 获取即将 联赛数据
+     */
     public static function getSoonLeagueData($source,$models,$where,$search=''){
         $model_match = $models['model_match'];
         $model_league = $models['model_league'];
@@ -48,7 +51,6 @@ class St_zq_league extends Model
             ->join($model_match,$model_match.'.lg_id',$model_league.'.id')
             ->select($model_league.'.id as lg_id',$model_league.'.name_chinese as leagueName')
             ->distinct($model_league.'.name_chinese')
-//            ->where($model_league.'.source',$source['source'])
             ->where([[$model_league.'.name_chinese','!=','']])
             ->where($where)
             ->where(function($query)use ($model_match,$search){
@@ -63,7 +65,9 @@ class St_zq_league extends Model
         return $data;
     }
 
-    //获取非滚球 联赛下赛事数据 用于统计数量
+    /*
+     * 获取非滚球 联赛下赛事数据 用于统计数量
+     */
     public static function getLeagueMatchData($models,$where){
         $model_match = $models['model_match'];
         $model_league = $models['model_league'];

+ 56 - 41
Biz/Common/CommonFunction.php

@@ -723,9 +723,11 @@ class CommonFunction {
                     $where = [
                         ['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())]
+                        /*
+                        ['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'://即将 今日两小时内开始
@@ -734,42 +736,47 @@ class CommonFunction {
                         ['match_date','=',date("Y-m-d")],
                         ['match_time','<',date("H:i:s", strtotime("+2 hour"))],
                         ['match_time','>',date("H:i:s", time())]
-
-//                    ['utime','>',date("Y-m-d").' 00:00:00']
+                        /*
+                        ['utime','>',date("Y-m-d").' 00:00:00']
+                        */
                     ];
                     break;
                 case 'StToday'://今日 今日未开始未结束
                     $where = [
-//                        ['is_today', '=', 1],
-
-//                    ['type', '=', '1'],
                         ['status', '<', '2'],
                         ['match_date','=',date("Y-m-d")],
                         ['match_time','>',date("H:i:s", time())],
-//                    ['utime','>',date("Y-m-d").' 00:00:00']
+                        /*
+                        ['is_today', '=', 1],
+                        ['type', '=', '1'],
+                        ['utime','>',date("Y-m-d").' 00:00:00']
+                        */
                     ];
                     break;
                 case 'StMorningPlate'://早盘
                     $where = [
+                        ['status', '<', '2'],
                         ['is_morningplate', '=', 1],
                         ['us_time','>',$this->qgmdate('Y-m-d H:i:s', '', -4)],
-//                    ['match_date','>',date("Y-m-d",time())],
-//                    ['match_time','>',date("H:i:s", time())],
-//                    ['type', '=', '2'],
-                    ['status', '<', '2'],
-//                    ['utime','>',date("Y-m-d").' 00:00:00']
+                        /*
+                        ['match_date','>',date("Y-m-d",time())],
+                        ['match_time','>',date("H:i:s", time())],
+                        ['type', '=', '2'],
+                        ['utime','>',date("Y-m-d").' 00:00:00']
+                        */
                     ];
                     break;
                 case 'StStringScene'://串场
                     $where = [
+                        ['status', '<', '2'],
                         ['is_stringscene', '=', 1],
                         ['us_time','>',$this->qgmdate('Y-m-d H:i:s', '', -4)],
-
-//                    ['match_date','>',date("Y-m-d",time())],
-//                    ['match_time','>',date("H:i:s", time())],
-//                    ['type', '=', '3'],
-                    ['status', '<', '2'],
-//                    ['utime','>',date("Y-m-d").' 00:00:00']
+                        /*
+                        ['match_date','>',date("Y-m-d",time())],
+                        ['match_time','>',date("H:i:s", time())],
+                        ['type', '=', '3'],
+                        ['utime','>',date("Y-m-d").' 00:00:00']
+                        */
                     ];
                     break;
                 case 'StChampion'://冠军
@@ -786,11 +793,12 @@ class CommonFunction {
                     $where = [
                         [$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.'.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())]
+                        */
                     ];
                     break;
                 case 'StSoon'://即将 今日两小时内开始
@@ -799,17 +807,21 @@ class CommonFunction {
                         [$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']
+                        /*
+                        [$model_match.'.utime','>',date("Y-m-d").' 00:00:00']
+                        */
                     ];
                     break;
                 case 'StToday'://今日 今日未开始未结束
                     $where = [
-//                        [$model_match.'.is_today','=',1],
-//                    [$model_match.'.type', '=', '1'],
-                    [$model_match.'.status', '<', '2'],
+                        [$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.'.utime','>',date("Y-m-d").' 00:00:00'],
+                        [$model_match.'.is_today','=',1],
+                        [$model_match.'.type', '=', '1'],
+                        */
                     ];
                     break;
                 case 'all'://所有赛事
@@ -819,25 +831,28 @@ class CommonFunction {
                     break;
                 case 'StMorningPlate'://早盘
                     $where = [
+                        [$model_match.'.status', '<', '2'],
                         [$model_match.'.is_morningplate','=',1],
                         [$model_match.'.us_time','>',$this->qgmdate('Y-m-d H:i:s', '', -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.'.status', '<', '2'],
-//                    [$model_match.'.utime','>',date("Y-m-d").' 00:00:00']
+                        /*
+                        [$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 = [
                         [$model_match.'.is_stringscene','=',1],
                         [$model_match.'.us_time','>',$this->qgmdate('Y-m-d H:i:s', '', -4)],
-
-//                    [$model_match.'.match_date','>',date("Y-m-d",time())],
-//                    [$model_match.'.match_time','>',date("H:i:s", time())],
-//                    [$model_match.'.type', '=', '3'],
-                    [$model_match.'.status', '<', '2'],
-//                    [$model_match.'.utime','>',date("Y-m-d").' 00:00:00']
+                        [$model_match.'.status', '<', '2'],
+                        /*
+                        [$model_match.'.match_date','>',date("Y-m-d",time())],
+                        [$model_match.'.match_time','>',date("H:i:s", time())],
+                        [$model_match.'.type', '=', '3'],
+                        [$model_match.'.utime','>',date("Y-m-d").' 00:00:00']
+                        */
                     ];
                     break;
                 case 'StChampion'://冠军

+ 0 - 7
Biz/Match/GetOddsData.php

@@ -28,14 +28,12 @@ class GetOddsData {
 
         $league = lm($model_league, 'Sports')
             ->select('id as lg_id','name_chinese')
-//            ->where($source)
             ->where(['id'=>$data['leagueID']])
             ->first();
         if(empty($league->lg_id))  throw new \Exception(Render([], '10003', lang('Tips','Sports')->get('PARAM_ERROR')));
 
         $matchData = lm($model_match, 'Sports')
             ->select('lg_id','id as match_id','tag','match_date','match_time','home_team','guest_team')
-//            ->where($source)
             ->where(['lg_id'=>$data['leagueID']])
             ->where($whereDate)
             ->where($model_match.'.us_time','>',qgmdate('Y-m-d H:i:s', '', -4))
@@ -77,7 +75,6 @@ class GetOddsData {
             'leagueName'=>$league->name_chinese,
             'matchNum'=>count($list) ,
             'matchData'=>$list,
-//                'lang' => lang('OddsTemp','Sports')->getAll(),
         ];
 
         return $data;
@@ -100,7 +97,6 @@ class GetOddsData {
         $oddsData = lm($model_odds, 'Sports')
             ->select('match_id','id','p_code','odds_code','status','odds','condition','sort','odds_only')
             ->whereIn('match_id',$match_ids)
-//            ->where($source)
             ->where(
                 function($query)use ($model_odds){
                     $query->where($model_odds.'.odds_code','concede_home')
@@ -148,7 +144,6 @@ class GetOddsData {
         }
         $oddsData = lm($model_odds, 'Sports')
             ->select('match_id','id','p_code','odds_code','status','odds','condition','sort','odds_only')
-//            ->where($source)
             ->whereIn('match_id',$match_ids)
             ->where(
                 function($query)use ($model_odds){
@@ -196,7 +191,6 @@ class GetOddsData {
         }
         $oddsData = lm($model_odds, 'Sports')
             ->select('match_id','id','p_code','odds_code','status','odds','condition','sort','odds_only')
-//            ->where($source)
             ->whereIn('match_id',$match_ids)
             ->where(
                 function($query)use ($model_odds){
@@ -243,7 +237,6 @@ class GetOddsData {
         }
         $oddsData = lm($model_odds, 'Sports')
             ->select('match_id','id','p_code','odds_code','status','odds','condition','sort','odds_only')
-//            ->where($source)
             ->whereIn('match_id',$match_ids)
             ->where(
                 function($query)use ($model_odds){

+ 0 - 24
Biz/Match/GetmatchData.php

@@ -328,7 +328,6 @@ class GetmatchData {
      */
     public function getToday($source,$models,$where,$lg_id=0,$search='',$oddsTypeWhere=[]){
         //获取model
-
         $model_match = $models['model_match'];
         $model_odds = $models['model_odds'];
         $model_league = $models['model_league'];
@@ -398,14 +397,10 @@ class GetmatchData {
         if($lg_id >0){
             $last_time = lm($model_league, 'Sports')
                 ->select('last_time')
-//                ->where($model_odds.'.expire_time','>',date("Y-m-d H:i:s"))
-//                ->where($source)
                 ->where('id',$lg_id)
                 ->first()->last_time;
             $championData = lm($model_odds, 'Sports')
                 ->select("id","lg_id","match_id","p_code","odds_code","team","odds","sort","status","odds_only")
-//                ->where($model_odds.'.expire_time','>',date("Y-m-d H:i:s"))
-//                ->where($source)
                 ->where('lg_id',$lg_id)
                 ->where($where)
                 ->groupBy("id","lg_id","match_id","p_code","odds_code","team","odds","sort","status","odds_only")
@@ -440,10 +435,8 @@ class GetmatchData {
         $country = lm($model_league,"Sports")
             ->leftjoin('st_area_country','st_area_country.id',$model_league.'.country_id')
             ->select('st_area_country.id as country_id','st_area_country.name as region')
-//            ->select('st_country.country_id as region_id','st_country.name_chinese as region',$model_league.'.lg_id', $model_league.'.name_chinese as league')
             ->distinct('st_area_country.name')
             ->where([[$model_league.'.name_chinese','!=','']])
-//            ->where($model_league.'.source',$source['source'])
             ->where($model_league.'.name_chinese','like','%'.$search.'%')
             ->get()
             ->toArray();
@@ -451,10 +444,8 @@ class GetmatchData {
         $area = lm($model_league,"Sports")
             ->leftjoin('st_area_country','st_area_country.id',$model_league.'.area_id')
             ->select('st_area_country.id as area_id','st_area_country.name as region')
-//            ->select('st_area.id as region_id','st_area.title as region',$model_league.'.lg_id', $model_league.'.name_chinese as league')
             ->distinct('st_area_country.name')
             ->where([[$model_league.'.name_chinese','!=','']])
-//            ->where($model_league.'.source',$source['source'])
             ->where($model_league.'.name_chinese','like','%'.$search.'%')
             ->get()
             ->toArray();
@@ -476,7 +467,6 @@ class GetmatchData {
     public function getMatchNum($source,$country,$area,$model_league,$model_match='',$model_odds='',$where,$search,$time='',$type=0){
         $leagueData = lm($model_league,'Sports')
             ->select('id as lg_id','name_chinese as league','country_id','area_id')
-//            ->where($source)
             ->where([[$model_league.'.name_chinese','!=','']])
             ->where($model_league.'.name_chinese','like','%'.$search.'%')
             ->get()
@@ -493,7 +483,6 @@ class GetmatchData {
         $matchData = lm($model_match,'Sports')
             ->select('id as match_id','lg_id')
             ->where($where)
-//            ->where($source)
             ->where($timeWhere)
             ->get()
             ->toArray();
@@ -530,7 +519,6 @@ class GetmatchData {
                         if($v['area_id'] == $vv['area_id']){
                             $areaData[$k]['league_count'][] = $vv;
                         }
-
                     }
                 }
             }
@@ -556,7 +544,6 @@ class GetmatchData {
 
         $leagueData = lm($model_league,'Sports')
             ->select('id as lg_id','name_chinese as league','country_id','area_id')
-//            ->where($source)
             ->where([[$model_league.'.name_chinese','!=','']])
             ->where($model_league.'.name_chinese','like','%'.$search.'%')
             ->get()
@@ -566,7 +553,6 @@ class GetmatchData {
             ->select('id','lg_id','p_code')
             ->distinct("p_code")//去重
             ->where($where)
-//            ->where($source)
             ->get()
             ->toArray();
 
@@ -626,7 +612,6 @@ class GetmatchData {
     public function getMatchOdds($source,$model_league,$model_match,$model_odds,$where,$search,$lg_id,$time='',$oddsTypeWhere=[]){
         $leagueData = lm($model_league,"Sports")
             ->select('id as lg_id','name_chinese as leagueName')
-//            ->where($source)
             ->where('id',$lg_id)
             ->first();
         //根据时间 拼装查询条件
@@ -655,7 +640,6 @@ class GetmatchData {
 
         $matchData = lm($model_match,"Sports")
             ->select($model_match.'.id as match_id',$model_match.'.tag','match_date',$model_match.'.match_time',$model_match.'.home_team',$model_match.'.guest_team')
-//            ->where($source)
             ->where($model_match.'.lg_id',$lg_id)
             ->where($where)
             ->where($whereTime)
@@ -709,7 +693,6 @@ class GetmatchData {
 
                 $matchData = lm($model['model_match'], 'Sports')
                     ->select('id as match_id','home_team','guest_team','match_time','us_time')
-//                    ->where($source)
                     ->where($where)
                     ->orderBy('match_time','asc')
                     ->get()->toArray();
@@ -748,7 +731,6 @@ class GetmatchData {
         $model_league = $model['model_league'];
         $leagueData = lm($model_league,'Sports')
             ->select('name_chinese','id as lg_id','last_time')
-//            ->where($model_league.'.source',$source['source'])
             ->where($model_league.'.name_chinese','欧洲冠军杯')
             ->first();
         //获取滚球数据
@@ -800,7 +782,6 @@ class GetmatchData {
         $matchData = lm($model_match,"Sports")
             ->leftjoin($model_result,$model_result.'.match_id',$model_match.'.id')
             ->select($model_match.'.id as match_id',$model_match.'.tag','match_date',$model_match.'.match_time',$model_match.'.home_team',$model_match.'.guest_team','home_score','guest_score',$model_result.'.match_time as a_time','match_process')
-//            ->where($model_match.'.source',$source['source'])
             ->where($model_match.'.lg_id',$lg_id)
             ->where($where)
             ->where(function($query)use ($model_match,$search){
@@ -848,7 +829,6 @@ class GetmatchData {
         $where = $this->commonFunction->getState($type_code);
         $matchData = lm($model_match,'Sports')
             ->select('id as match_id','match_date','match_time','tag','home_team','guest_team')
-//            ->where($model_match.'.source',$source['source'])
             ->where($where)
             ->where('lg_id',$lg_id)
             ->where(function($query)use ($model_match,$search){
@@ -867,7 +847,6 @@ class GetmatchData {
         //获取赔率数据
         $oddsData = lm($model_odds, "Sports")
             ->select( 'id','p_code', 'odds_code','odds_only','status', 'odds', 'condition', 'sort','match_id')
-//            ->where('source',$source['source'])
             ->whereIn('match_id', $match_ids)
             ->groupBy($model_odds . '.id','p_code', 'odds_code','odds_only', $model_odds . '.status', 'odds', 'condition', 'sort','match_id')
             ->orderBy($model_odds . '.id','desc')
@@ -894,7 +873,6 @@ class GetmatchData {
 
         $matchData = lm($model_match,'Sports')
             ->select('id as match_id','match_date','match_time','tag','home_team','guest_team')
-//            ->where($model_match.'.source',$source['source'])
             ->where($where)
             ->where('lg_id',$lg_id)
             ->where(function($query)use ($model_match,$search){
@@ -919,8 +897,6 @@ class GetmatchData {
         $where = $this->commonFunction->getState($type_code);
         $championData = lm($model_odds, 'Sports')
             ->select("id","lg_id","match_id","p_code","odds_code","team","odds","sort","status","odds_only")
-//                ->where($model_odds.'.expire_time','>',date("Y-m-d H:i:s"))
-//            ->where($source)
             ->where('lg_id',$lg_id)
             ->where($where)
             ->groupBy("id","lg_id","match_id","p_code","odds_code","team","odds","sort","status","odds_only")