Browse Source

异常处理

彭俊 6 years ago
parent
commit
28e320955a
2 changed files with 7 additions and 58 deletions
  1. 6 6
      app/Http/Model/StLqResult.php
  2. 1 52
      app/Lib/Biz/Sport/Common.php

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

@@ -200,16 +200,16 @@ class StLqResult extends Model
                     //拼接赛事主队比分  {"1":0,"2":0,"3":0,"4":0}
                     //拼接赛事主队比分  {"1":0,"2":0,"3":0,"4":0}
                     $home_score = [
                     $home_score = [
                         '1'=>$result_1['home_score'],
                         '1'=>$result_1['home_score'],
-                        '2'=>$result_2['home_score'],
-                        '3'=>$result_3['home_score'],
-                        '4'=>$result_4['home_score']
+                        '2'=>$result_2['home_score'] - $result_1['home_score'],
+                        '3'=>$result_3['home_score'] - $result_2['home_score'],
+                        '4'=>$result_4['home_score'] - $result_3['home_score'],
                     ];
                     ];
                     //拼接赛事客队比分
                     //拼接赛事客队比分
                     $guest_score = [
                     $guest_score = [
                         '1'=>$result_1['guest_score'],
                         '1'=>$result_1['guest_score'],
-                        '2'=>$result_2['guest_score'],
-                        '3'=>$result_3['guest_score'],
-                        '4'=>$result_4['guest_score']
+                        '2'=>$result_2['guest_score'] - $result_1['guest_score'],
+                        '3'=>$result_3['guest_score'] - $result_2['guest_score'],
+                        '4'=>$result_4['guest_score'] - $result_3['guest_score'],
                     ];
                     ];
 
 
                     //获取获胜球队
                     //获取获胜球队

+ 1 - 52
app/Lib/Biz/Sport/Common.php

@@ -1296,61 +1296,10 @@ class Common
                 } 
                 } 
             } 
             } 
         } 
         } 
-    //   return $newarray;  
+        return [];
     } 
     } 
 
 
 
 
-    static function filter_by_value_1111 ($array,$match_id){ 
-        $data_json= json_encode($array); 
-        $data_arr = json_decode($data_json,true);
-
-
-        /*
-        $newarray = [
-            'match_id'=> 1,
-            'home_score'=> 1,
-            'guest_score'=> 2,
-            'a_time'=> 0,
-            'home_rate'=> 0,
-            'guest_rate'=> 0,
-            'match_process'=> 0,
-            'first_score'=> '',
-            'last_score'=> '',
-            'match_score'=> '',
-            'match_winer'=>''
-        ];
-
-        return $newarray;
-
-        */
-
-        $newarray = [];
-
-        if(is_array($data_arr) && count($data_arr)>0)  
-        { 
-            foreach($data_arr as $k=>$v){
-                if($v['match_id'] == $match_id){
-                    $newarray = $v;
-                    // $newarray[$k] = [
-                    //     'match_id'=> $v->match_id,
-                    //     'home_score'=> $v->home_score,
-                    //     'guest_score'=> $v->guest_score,
-                    //     'a_time'=> $v->a_time,
-                    //     'home_rate'=> $v->home_rate,
-                    //     'guest_rate'=> $v->guest_rate,
-                    //     'match_process'=> $v->match_process,
-                    //     'first_score'=> $v->first_score,
-                    //     'last_score'=> $v->last_score,
-                    //     'match_score'=> $v->match_score,
-                    //     'match_winer'=> $v->match_winer
-                    // ];       
-                }
-
-            }
-        } 
-
-        return $$newarray;
-    } 
 }
 }
 
 
 ?>
 ?>