彭俊 6 жил өмнө
parent
commit
3050f74f43

+ 28 - 9
app/Http/Controllers/Api/WriteSportsController.php

@@ -316,14 +316,32 @@ class WriteSportsController extends BaseController{
                     foreach($matchData_y as $kk=> $vv){
                         if($v['match_id'] == $vv['others_match_id']){
                             $data = $v;
-                            $up_match = [
-                                'utime'=>date('Y-m-d H:i:s'),
-                                'status'=>$data['status'],
-                                'is_rollball'=>$data['is_rollball']?:0,
-                                'is_today'=>$data['is_today']?:0,
-                                'is_morningplate'=>$data['is_morningplate']?:0,
-                                'is_stringscene'=>$data['is_stringscene']?:0,
-                            ];         
+                            $up_match=[];
+                            $up_match['utime'] = date('Y-m-d H:i:s');
+                            $up_match['status'] = $data['status'];
+                            if($data['is_rollball'] == 1){
+                                $up_match['is_rollball'] = $data['is_rollball'];
+                            }
+                            if($data['is_today'] == 1){
+                                $up_match['is_today'] = $data['is_today'];
+                            }
+                            if($data['is_morningplate'] == 1){
+                                $up_match['is_morningplate'] = $data['is_morningplate'];
+                            }
+                            if($data['is_stringscene'] == 1){
+                                $up_match['is_stringscene'] = $data['is_stringscene'];
+                            }
+
+
+                            // $up_match = [
+                            //     'utime'=>date('Y-m-d H:i:s'),
+                            //     'status'=>$data['status'],
+                            //     'is_rollball'=>$data['is_rollball']?:0,
+                            //     'is_today'=>$data['is_today']?:0,
+                            //     'is_morningplate'=>$data['is_morningplate']?:0,
+                            //     'is_stringscene'=>$data['is_stringscene']?:0,
+                            // ];    
+
                             //如果是网球 追加rule 字段
                             if($game_code == 'wq' and !empty($data['rule'])){
                                 $up_match['rule'] = $data['rule'];
@@ -379,7 +397,8 @@ class WriteSportsController extends BaseController{
                                 'us_time'=>$data['us_time']?:commonFunction::qgmdate('Y-m-d H:i:s', '', -4),
                                 'half_match_id'=>$half_match_id?:0,
                                 'identity' => $data['uuid'],
-                            ];         
+                            ];     
+
                             //如果是网球 追加rule 字段
                             if($game_code == 'wq'){
                                 $set_match['rule'] = $data['rule'];