|
@@ -375,12 +375,12 @@ class StZqResult extends Model
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
//上半场
|
|
//上半场
|
|
|
- $sql_h = "select a.match_id,a.home_team,a.guest_team,a.home_score,a.guest_score,a.match_time as a_time,a.match_process,a.all_goal,a.first_score,a.last_score,a.match_score,a.match_winer from st_zq_result_record a,
|
|
|
|
|
|
|
+ $sql_h = "select a.match_id,a.home_team,a.guest_team,a.home_score,a.guest_score,a.corner_result,a.penalty_result,a.match_time as a_time,a.match_process,a.all_goal,a.first_score,a.last_score,a.match_score,a.match_winer from st_zq_result_record a,
|
|
|
(select match_id,max(id) id from st_zq_result_record where match_process = '半场' and match_id IN ($match_ids_str) group by match_id)b
|
|
(select match_id,max(id) id from st_zq_result_record where match_process = '半场' and 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 ";
|
|
|
|
|
|
|
|
//全场
|
|
//全场
|
|
|
- $sql_f = "select a.match_id,a.home_team,a.guest_team,a.home_score,a.guest_score,a.match_time as a_time,a.match_process,a.all_goal,a.first_score,a.last_score,a.match_score,a.match_winer,a.home_rate,a.guest_rate from st_zq_result_record a,
|
|
|
|
|
|
|
+ $sql_f = "select a.match_id,a.home_team,a.guest_team,a.home_score,a.guest_score,a.corner_result,a.penalty_result,a.match_time as a_time,a.match_process,a.all_goal,a.first_score,a.last_score,a.match_score,a.match_winer,a.home_rate,a.guest_rate from st_zq_result_record a,
|
|
|
(select match_id,max(id) id from st_zq_result_record where match_id IN ($match_ids_str) group by match_id)b
|
|
(select match_id,max(id) id from st_zq_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 ";
|
|
|
|
|
|
|
@@ -414,6 +414,8 @@ class StZqResult extends Model
|
|
|
"u_guest_score"=> $v->guest_score,
|
|
"u_guest_score"=> $v->guest_score,
|
|
|
"home_rate"=> $vv->home_rate,
|
|
"home_rate"=> $vv->home_rate,
|
|
|
"guest_rate"=> $vv->guest_rate,
|
|
"guest_rate"=> $vv->guest_rate,
|
|
|
|
|
+ "corner_result" => $vv->corner_result,
|
|
|
|
|
+ "penalty_result" => $vv->penalty_result,
|
|
|
];
|
|
];
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -451,6 +453,8 @@ class StZqResult extends Model
|
|
|
"u_guest_score"=> $v['u_guest_score']?:0,//上半场客队进球数
|
|
"u_guest_score"=> $v['u_guest_score']?:0,//上半场客队进球数
|
|
|
"is_correct"=> -1,//自动比分
|
|
"is_correct"=> -1,//自动比分
|
|
|
"manual_result"=> $manual_result_json,//手动结果
|
|
"manual_result"=> $manual_result_json,//手动结果
|
|
|
|
|
+ "corner_ball" => $v['corner_result'],//角球结果
|
|
|
|
|
+ "penalty_card" => $v['penalty_result'],//罚牌结果
|
|
|
];
|
|
];
|
|
|
$ret = $model['model_result']::where(['match_id' => $v['match_id'],'is_correct'=>-1])
|
|
$ret = $model['model_result']::where(['match_id' => $v['match_id'],'is_correct'=>-1])
|
|
|
->update($set_match_r);
|
|
->update($set_match_r);
|
|
@@ -473,6 +477,11 @@ class StZqResult extends Model
|
|
|
$manual_result_json = $resultData['manual_result'];
|
|
$manual_result_json = $resultData['manual_result'];
|
|
|
//手动结果数据 arr
|
|
//手动结果数据 arr
|
|
|
$manual_result_arr = json_decode($manual_result_json,true);
|
|
$manual_result_arr = json_decode($manual_result_json,true);
|
|
|
|
|
+ //角球数据
|
|
|
|
|
+ $corner_result_arr = json_decode($auto_result['corner_result'],true);
|
|
|
|
|
+ //罚牌数据
|
|
|
|
|
+ $penalty_result_arr = json_decode($auto_result['penalty_result'],true);
|
|
|
|
|
+
|
|
|
|
|
|
|
|
//拼接手动数据
|
|
//拼接手动数据
|
|
|
foreach($manual_result_arr as $kk=>$vv){
|
|
foreach($manual_result_arr as $kk=>$vv){
|
|
@@ -480,15 +489,15 @@ class StZqResult extends Model
|
|
|
if($kk == 'half_corner'){
|
|
if($kk == 'half_corner'){
|
|
|
//赋值 上半场角球
|
|
//赋值 上半场角球
|
|
|
if(empty($vv['home']) || empty($vv['guest'])){
|
|
if(empty($vv['home']) || empty($vv['guest'])){
|
|
|
- $vv['home'] = 0;
|
|
|
|
|
- $vv['guest'] = 0;
|
|
|
|
|
|
|
+ $vv['home'] = $corner_result_arr['home_half']?:0;
|
|
|
|
|
+ $vv['guest'] = $corner_result_arr['guest_half']?:0;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
//全场角球
|
|
//全场角球
|
|
|
if($kk == 'all_corner'){
|
|
if($kk == 'all_corner'){
|
|
|
if(empty($vv['home']) || empty($vv['guest'])){
|
|
if(empty($vv['home']) || empty($vv['guest'])){
|
|
|
- $vv['home'] = 0;
|
|
|
|
|
- $vv['guest'] = 0;
|
|
|
|
|
|
|
+ $vv['home'] = $corner_result_arr['home']?:0;
|
|
|
|
|
+ $vv['guest'] = $corner_result_arr['guest']?:0;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
//上半场比分
|
|
//上半场比分
|
|
@@ -508,16 +517,16 @@ class StZqResult extends Model
|
|
|
//上半场罚牌
|
|
//上半场罚牌
|
|
|
if($kk == 'half_penalty'){
|
|
if($kk == 'half_penalty'){
|
|
|
if(empty($vv['home']) || empty($vv['guest'])){
|
|
if(empty($vv['home']) || empty($vv['guest'])){
|
|
|
- $vv['home'] = 0;
|
|
|
|
|
- $vv['guest'] = 0;
|
|
|
|
|
|
|
+ $vv['home'] = $penalty_result_arr['home_half']?:0;
|
|
|
|
|
+ $vv['guest'] = $penalty_result_arr['guest_half']?:0;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
//全场罚牌
|
|
//全场罚牌
|
|
|
if($kk == 'all_penalty'){
|
|
if($kk == 'all_penalty'){
|
|
|
if(empty($vv['home']) || empty($vv['guest'])){
|
|
if(empty($vv['home']) || empty($vv['guest'])){
|
|
|
- $vv['home'] = 0;
|
|
|
|
|
- $vv['guest'] = 0;
|
|
|
|
|
|
|
+ $vv['home'] = $penalty_result_arr['home_half']?:0;
|
|
|
|
|
+ $vv['guest'] = $penalty_result_arr['guest_half']?:0;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
//首进球时间
|
|
//首进球时间
|