彭俊 пре 6 година
родитељ
комит
ea3976a295
1 измењених фајлова са 6 додато и 1 уклоњено
  1. 6 1
      app/Http/Model/StLqResult.php

+ 6 - 1
app/Http/Model/StLqResult.php

@@ -295,13 +295,18 @@ class StLqResult extends Model
         (select match_id,max(id) id from st_lq_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 = DB::select($sql_result);
 
         if(!empty($match_result)){
             foreach($match_result as $k=>$v){
                 //获取结果json
                 $mark_result = json_decode($v->result_mark,true);
+                //如果为空,设默认值
+                if($mark_result == []){
+                    $mark_result_json = '{"schedule":"ot","r_time":"00:00","sc_1th_H":0,"sc_1th_C":0,"sc_2th_H":0,"sc_2th_C":0,"sc_3th_H":0,"sc_3th_C":0,"sc_4th_H":0,"sc_4th_C":0,"overtime_H":0,"overtime_C":0,"half_H":0,"half_C":0,"full_H":0,"full_C":0,"whole_H":0,"whole_C":0}';
+                    $mark_result = json_decode($mark_result_json,true);
+                }
                 //获取总进球数
                 $all_goal = $mark_result['whole_H']+$mark_result['whole_C'];
                 //获取比分