浏览代码

异常处理

彭俊 6 年之前
父节点
当前提交
15619cf686
共有 1 个文件被更改,包括 3 次插入20 次删除
  1. 3 20
      app/Http/Controllers/Api/WriteSportsController.php

+ 3 - 20
app/Http/Controllers/Api/WriteSportsController.php

@@ -436,27 +436,10 @@ class WriteSportsController extends BaseController
                     foreach ($match_uuids as $kk => $match_identity) {
                         if ($v['match_identity'] == $match_identity) {
                             $data = $v;
-                            /*
                             //===追加查询 该赛事 本地是否存在 同联赛同球队 记录
-                            //查询赛事
-                            $matchData = $models['model_match']::where(['home_team' => $data['home_team'],'guest_team' => $data['guest_team'],'identity'=>$data['uuid']])->first();
-                            //如果已存在,删除
-                            if($matchData->id){
-                                //删除赔率 记录
-                                $del_odds_r =  $models['model_odds_record']::where(['match_id' => $matchData->id])->delete();
-                                //删除赔率
-                                $del_odds =  $models['model_odds']::where(['match_id' => $matchData->id])->delete();
-                                //删除赛事结果记录
-                                $del_result_record =  $models['model_result_record']::where(['match_id' => $matchData->id])->delete();
-                                //删除赛事结果
-                                $del_result =  $models['model_result']::where(['match_id' => $matchData->id])->delete();
-                                //删除中间表记录
-                                $del_local_match =  $models['model_local_match']::where(['match_id' => $matchData->id])->delete();
-                                //
-                                $models['model_match']::where(['id' => $matchData->id])->delete();
-                            }
-                            */
-
+                            //查询赛事 如果存在 则更新为 已取消
+                            $matchData = $models['model_match']::where(['home_team' => $data['home_team'],'guest_team' => $data['guest_team'],'identity'=>$data['uuid']])
+                                ->update(['status'=>6]);
                             //===end===
                             $half_match_id = $v['half_match_id'];
                             //获取 本地 联赛 ID