|
@@ -66,7 +66,7 @@ class MatchListWeb extends Controller{
|
|
|
//获取滚球
|
|
//获取滚球
|
|
|
public function getRollBall($type,$game_code,$p_code){
|
|
public function getRollBall($type,$game_code,$p_code){
|
|
|
//根据球类代码及玩法代码 获取相关赛事赔率数据
|
|
//根据球类代码及玩法代码 获取相关赛事赔率数据
|
|
|
- if(!empty($game_code) and !empty($p_code)){
|
|
|
|
|
|
|
+ if(!empty($game_code)){
|
|
|
$matchData = $this->getMatchData($type,$game_code,$p_code);
|
|
$matchData = $this->getMatchData($type,$game_code,$p_code);
|
|
|
|
|
|
|
|
Render($matchData, '1', lang('Tips','Sports')->get('success'));
|
|
Render($matchData, '1', lang('Tips','Sports')->get('success'));
|
|
@@ -134,6 +134,7 @@ class MatchListWeb extends Controller{
|
|
|
|
|
|
|
|
$select = [$models['model_match'].'.match_id'];
|
|
$select = [$models['model_match'].'.match_id'];
|
|
|
$timeWhere = [];
|
|
$timeWhere = [];
|
|
|
|
|
+ //如果有传玩法代码,则获取查询字段
|
|
|
if($p_code){
|
|
if($p_code){
|
|
|
//时间条件
|
|
//时间条件
|
|
|
if(!empty($time)){
|
|
if(!empty($time)){
|
|
@@ -149,7 +150,10 @@ class MatchListWeb extends Controller{
|
|
|
$select = [$models['model_league'].'.lg_id',$models['model_league'].'.name_chinese as leagueName',$models['model_match'].'.match_id','home_team','guest_team','match_date','match_time','tag','country_id','area_id'];
|
|
$select = [$models['model_league'].'.lg_id',$models['model_league'].'.name_chinese as leagueName',$models['model_match'].'.match_id','home_team','guest_team','match_date','match_time','tag','country_id','area_id'];
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+ //如果是滚球
|
|
|
|
|
+ if($type == 'StRollBall'){
|
|
|
|
|
+ $select = [$models['model_league'].'.lg_id',$models['model_league'].'.name_chinese as leagueName',$models['model_match'].'.match_id','home_team','guest_team','match_date','match_time','tag','country_id','area_id'];
|
|
|
|
|
+ }
|
|
|
//赛事数据
|
|
//赛事数据
|
|
|
$matchNum = lm($models['model_league'],"Sports")
|
|
$matchNum = lm($models['model_league'],"Sports")
|
|
|
->join($models['model_match'],$models['model_match'].'.lg_id',$models['model_league'].'.lg_id')
|
|
->join($models['model_match'],$models['model_match'].'.lg_id',$models['model_league'].'.lg_id')
|
|
@@ -158,10 +162,9 @@ class MatchListWeb extends Controller{
|
|
|
->where($where)
|
|
->where($where)
|
|
|
->where($timeWhere)
|
|
->where($timeWhere)
|
|
|
->get()->toArray();
|
|
->get()->toArray();
|
|
|
- //
|
|
|
|
|
|
|
|
|
|
//赔率数据
|
|
//赔率数据
|
|
|
- $oddsCodeNum = $this->getOddsData($game_code,$models['model_odds'],$matchNum,$p_code);
|
|
|
|
|
|
|
+ $oddsCodeNum = $this->getOddsData($game_code,$models['model_odds'],$matchNum,$p_code,$type);
|
|
|
if($p_code){
|
|
if($p_code){
|
|
|
$match_odds = [];
|
|
$match_odds = [];
|
|
|
if($p_code == 'kemp'){
|
|
if($p_code == 'kemp'){
|
|
@@ -319,7 +322,7 @@ class MatchListWeb extends Controller{
|
|
|
return $oddsCodeNum;
|
|
return $oddsCodeNum;
|
|
|
}
|
|
}
|
|
|
//根据match_id获取赔率数据
|
|
//根据match_id获取赔率数据
|
|
|
- public function getOddsData($game_code,$model_odds,$match_ids,$p_code=''){
|
|
|
|
|
|
|
+ public function getOddsData($game_code,$model_odds,$match_ids,$p_code='',$type=''){
|
|
|
$match_id = [];
|
|
$match_id = [];
|
|
|
$lg_ids = [];
|
|
$lg_ids = [];
|
|
|
foreach ($match_ids as $k => $v){
|
|
foreach ($match_ids as $k => $v){
|