|
@@ -64,23 +64,39 @@ 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);
|
|
|
|
|
|
|
|
//处理赛事数据,追加比分及进程
|
|
//处理赛事数据,追加比分及进程
|
|
|
- foreach ($matchData as $k=>$v){
|
|
|
|
|
- foreach ($match_result_record as $kk => $vv){
|
|
|
|
|
- if($v['match_id'] == $vv->match_id){
|
|
|
|
|
- //如果是网球
|
|
|
|
|
- if($model_result == 'st_wq_result'){
|
|
|
|
|
- $matchData[$k]['home_player_score'] = $vv->home_player_score;
|
|
|
|
|
- $matchData[$k]['guest_player_score'] = $vv->guest_player_score;
|
|
|
|
|
|
|
+ if(!empty($matchData)){
|
|
|
|
|
+ foreach ($matchData as $k=>$v){
|
|
|
|
|
+ if( !empty($match_result_record)){
|
|
|
|
|
+ foreach ($match_result_record as $kk => $vv){
|
|
|
|
|
+ if($v['match_id'] == $vv->match_id){
|
|
|
|
|
+ //如果是网球
|
|
|
|
|
+ if($model_result == 'st_wq_result'){
|
|
|
|
|
+ $matchData[$k]['home_player_score'] = $vv->home_player_score?:0;
|
|
|
|
|
+ $matchData[$k]['guest_player_score'] = $vv->guest_player_score?:0;
|
|
|
|
|
+ }else{
|
|
|
|
|
+ $matchData[$k]['home_score'] = $vv->home_score?:0;
|
|
|
|
|
+ $matchData[$k]['guest_score'] = $vv->guest_score?:0;
|
|
|
|
|
+ }
|
|
|
|
|
+ $matchData[$k]['a_time'] = $vv->a_time?:0;
|
|
|
|
|
+ $matchData[$k]['match_process'] = $vv->match_process?:'NA';
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }else{
|
|
|
|
|
+ //如果是网球
|
|
|
|
|
+ if($model_result == 'st_wq_result'){
|
|
|
|
|
+ $matchData[$k]['home_player_score'] = 0;
|
|
|
|
|
+ $matchData[$k]['guest_player_score'] = 0;
|
|
|
}else{
|
|
}else{
|
|
|
- $matchData[$k]['home_score'] = $vv->home_score;
|
|
|
|
|
- $matchData[$k]['guest_score'] = $vv->guest_score;
|
|
|
|
|
|
|
+ $matchData[$k]['home_score'] = 0;
|
|
|
|
|
+ $matchData[$k]['guest_score'] = 0;
|
|
|
}
|
|
}
|
|
|
- $matchData[$k]['a_time'] = $vv->a_time;
|
|
|
|
|
- $matchData[$k]['match_process'] = $vv->match_process;
|
|
|
|
|
|
|
+ $matchData[$k]['a_time'] = 0;
|
|
|
|
|
+ $matchData[$k]['match_process'] = '';
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
return $matchData;
|
|
return $matchData;
|
|
|
}
|
|
}
|
|
|
|
|
|