|
|
@@ -144,6 +144,7 @@ class MatchList extends Controller {
|
|
|
$game_code = $_REQUEST['game_code'];//游戏代码
|
|
|
$code = $_REQUEST['code'];//参赛代码
|
|
|
$search = $_REQUEST['search'];//参赛代码
|
|
|
+ $lg_id = $_REQUEST['lg_id'];//参赛代码
|
|
|
//===查询该球类是否存在或启用===
|
|
|
$getModels = $this->commonFunction->getModels($game_code);
|
|
|
$st_league = $getModels['model_league'];
|
|
|
@@ -283,6 +284,23 @@ class MatchList extends Controller {
|
|
|
->distinct($st_competition.'.match_id')
|
|
|
->get()
|
|
|
->toarray();
|
|
|
+ break;
|
|
|
+ case $code == 'qt':
|
|
|
+ $where = [
|
|
|
+ [$st_competition.'.status','<', '2'],
|
|
|
+ [$st_competition.'.source',$this->source['source']],
|
|
|
+ [$st_competition.'.us_time','>',qgmdate('Y-m-d H:i:s', '', -4)],
|
|
|
+ [$st_league.'.lg_id',$lg_id]
|
|
|
+ ];
|
|
|
+ //指定联赛下的赛事
|
|
|
+ $data = lm($st_competition,'Sports')
|
|
|
+ ->join($st_league,$st_league.'.lg_id',$st_competition.'.lg_id')
|
|
|
+ ->select($st_league.'.name_chinese',$st_league.'.lg_id')
|
|
|
+ ->where($where)
|
|
|
+ ->where($where_search)
|
|
|
+ ->distinct($st_competition.'.match_id')
|
|
|
+ ->get()
|
|
|
+ ->toarray();
|
|
|
break;
|
|
|
}
|
|
|
//根据联赛ID赛事信息
|
|
|
@@ -559,7 +577,7 @@ class MatchList extends Controller {
|
|
|
|
|
|
$data = $_REQUEST;
|
|
|
try {
|
|
|
- if(empty($data['game_code']) || empty($data['leagueID'])){
|
|
|
+ if(empty($data['game_code']) || empty($data['leagueID']) || empty($data['oddsType'])){
|
|
|
throw new \Exception(Render([], '10001', lang('Tips','Sports')->get('PARAM_ERROR')));
|
|
|
}
|
|
|
|
|
|
@@ -574,8 +592,15 @@ class MatchList extends Controller {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ $models = $this->commonFunction->getModels($data['game_code'],0);
|
|
|
+ $model_match = $models['model_match'];
|
|
|
+ $model_odds = $models['model_odds'];
|
|
|
+ $model_league = $models['model_league'];
|
|
|
+ $model_result = $models['model_result'];
|
|
|
+
|
|
|
+ $oddsTypeWhere = $this->getOddsTypeWhere($model_odds,$data['oddsType']);
|
|
|
$source = $this->source;//数据源
|
|
|
- $data = $this->getOddsData->getOddsData($data,$whereDate,$source);
|
|
|
+ $data = $this->getOddsData->getOddsData($data,$whereDate,$source,$oddsTypeWhere);
|
|
|
Render($data, '1', lang('Tips','Sports')->get('success'));
|
|
|
|
|
|
} catch (\Exception $e) {
|
|
|
@@ -653,6 +678,37 @@ class MatchList extends Controller {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 根据赛事状态获取赔率查询条件
|
|
|
+ */
|
|
|
+ public function getOddsTypeWhere($model_odds,$oddsType){
|
|
|
+
|
|
|
+ //获取赛事不同状态下的赔率
|
|
|
+ if(!empty($oddsType)){
|
|
|
+ switch ($oddsType)
|
|
|
+ {
|
|
|
+ case 'StRollBall'://滚球
|
|
|
+ $oddsTypeWhere = [[$model_odds.'.is_rollball','=',1],];
|
|
|
+ break;
|
|
|
+ case 'StSoon'://即将
|
|
|
+ $oddsTypeWhere = [[$model_odds.'.is_morningplate','=',1],];
|
|
|
+ break;
|
|
|
+ case 'StToday'://今日
|
|
|
+ $oddsTypeWhere = [[$model_odds.'.is_today','=',1],];
|
|
|
+ break;
|
|
|
+ case 'StMorningPlate'://早盘
|
|
|
+ $oddsTypeWhere = [[$model_odds.'.is_morningplate','=',1],];
|
|
|
+ break;
|
|
|
+ case 'StStringScene'://串场
|
|
|
+ $oddsTypeWhere = [[$model_odds.'.is_stringscene','=',1],];
|
|
|
+ break;
|
|
|
+ default:
|
|
|
+ $oddsTypeWhere = [];
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ return $oddsTypeWhere;
|
|
|
+ }
|
|
|
/**
|
|
|
* 获取赛事所有玩法赔率数据
|
|
|
*/
|
|
|
@@ -674,30 +730,8 @@ class MatchList extends Controller {
|
|
|
$model_league = $models['model_league'];
|
|
|
$model_result = $models['model_result'];
|
|
|
|
|
|
- //获取赛事不同状态下的赔率
|
|
|
- if(!empty($oddsType)){
|
|
|
- switch ($oddsType)
|
|
|
- {
|
|
|
- case 'StRollBall'://滚球
|
|
|
- $oddsTypeWhere = [[$model_odds.'.is_rollball','=',1],];
|
|
|
- break;
|
|
|
- case 'StSoon'://即将
|
|
|
- $oddsTypeWhere = [[$model_odds.'.is_morningplate','=',1],];
|
|
|
- break;
|
|
|
- case 'StToday'://今日
|
|
|
- $oddsTypeWhere = [[$model_odds.'.is_today','=',1],];
|
|
|
- break;
|
|
|
- case 'StMorningPlate'://早盘
|
|
|
- $oddsTypeWhere = [[$model_odds.'.is_morningplate','=',1],];
|
|
|
- break;
|
|
|
- case 'StStringScene'://串场
|
|
|
- $oddsTypeWhere = [[$model_odds.'.is_stringscene','=',1],];
|
|
|
- break;
|
|
|
- default:
|
|
|
- $oddsTypeWhere = [];
|
|
|
- }
|
|
|
- }
|
|
|
|
|
|
+ $oddsTypeWhere = $this->getOddsTypeWhere($model_odds,$oddsType);
|
|
|
$oddsData = lm($model_odds, 'Sports')
|
|
|
->select('id','odds_only','p_code','odds_code',$model_odds.'.status','odds','condition','sort','source','utime')
|
|
|
->where($this->source)
|
|
|
@@ -715,6 +749,8 @@ class MatchList extends Controller {
|
|
|
->first();
|
|
|
// ->toarray();
|
|
|
|
|
|
+ if(empty($matchData)) Render([], '1', lang('Tips','Sports')->get('success'));
|
|
|
+
|
|
|
$matchData->ptime = '';//赛事进行时间
|
|
|
$matchData->match_score = '';//赛事比分
|
|
|
//如果该赛事正在进行,则获取进行时间
|