|
|
@@ -35,6 +35,7 @@ class St_zq_competition extends Model
|
|
|
public static function getRollMatchDataAll($source,$models,$where,$lg_ids=[],$ret){
|
|
|
$model_match = $models['model_match'];
|
|
|
$model_result = $models['model_result'];
|
|
|
+ $game_code = $ret['game_code'];
|
|
|
|
|
|
$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'];
|
|
|
|
|
|
@@ -55,15 +56,32 @@ class St_zq_competition extends Model
|
|
|
$result_record = $models['model_result_record'];
|
|
|
|
|
|
//如果是网球
|
|
|
- if($result_record == 'st_wq_result_record'){
|
|
|
- $sql = "select a.match_id,a.home_player_score,a.guest_player_score,a.match_time as a_time,a.match_process from $result_record a,
|
|
|
+// if($result_record == 'st_wq_result_record'){
|
|
|
+// $sql = "select a.match_id,a.home_player_score,a.guest_player_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 ";
|
|
|
+// }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 ";
|
|
|
+// }
|
|
|
+ //如果是网球
|
|
|
+ if($game_code == 'wq'){
|
|
|
+ $sql = "select a.match_id,a.home_player_score,a.guest_player_score,a.match_time as a_time,a.match_process,a.result_mark 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 ";
|
|
|
- }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 ";
|
|
|
- }
|
|
|
+}else
|
|
|
+//如果是棒球
|
|
|
+if($game_code == 'bq'){
|
|
|
+ $sql = "select a.match_id,a.home_score,a.guest_score,a.match_time as a_time,a.match_process,a.result_mark 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 ";
|
|
|
+}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 ";
|
|
|
+}
|
|
|
$match_result_record = S ('DB')->select ($sql);
|
|
|
|
|
|
//处理赛事数据,追加比分及进程
|
|
|
@@ -84,7 +102,8 @@ where a.match_id = b.match_id and a.id = b.id ";
|
|
|
$matchData[$k]['match_process'] = $vv->match_process?:C()->get('commonFunction')->getMatchProcess( $matchData[$k]['a_time'],$ret['game_code']);
|
|
|
}
|
|
|
}
|
|
|
- }else{
|
|
|
+ }
|
|
|
+ else{
|
|
|
//如果是网球
|
|
|
if($model_result == 'st_wq_result'){
|
|
|
$matchData[$k]['home_player_score'] = 0;
|
|
|
@@ -93,8 +112,8 @@ where a.match_id = b.match_id and a.id = b.id ";
|
|
|
$matchData[$k]['home_score'] = 0;
|
|
|
$matchData[$k]['guest_score'] = 0;
|
|
|
}
|
|
|
- $matchData[$k]['a_time'] = 0;
|
|
|
- $matchData[$k]['match_process'] = '';
|
|
|
+ $matchData[$k]['a_time'] = C()->get('commonFunction')->getMatchTime($v['match_date'],$v['match_time']);
|
|
|
+ $matchData[$k]['match_process'] = C()->get('commonFunction')->getMatchProcess( $matchData[$k]['a_time'],$ret['game_code']);
|
|
|
}
|
|
|
|
|
|
}
|