|
@@ -50,14 +50,16 @@ class St_zq_competition extends Model
|
|
|
//查询 赛事结果记录最新的一条
|
|
//查询 赛事结果记录最新的一条
|
|
|
$match_ids_str = implode(",", $match_ids);
|
|
$match_ids_str = implode(",", $match_ids);
|
|
|
$result_record = $models['model_result_record'];
|
|
$result_record = $models['model_result_record'];
|
|
|
- $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($result_record == 'st_wq_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,
|
|
$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
|
|
(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 ";
|
|
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);
|
|
$match_result_record = S ('DB')->select ($sql);
|
|
|
|
|
|