彭俊 6 anni fa
parent
commit
4be5b65a66

+ 5 - 1
app/Http/Controllers/Api/WriteSportsController.php

@@ -1994,7 +1994,6 @@ class WriteSportsController extends BaseController
             foreach ($local_match as $k => $v) {
                 foreach($data['data'] as $kk =>$vv){
                     if($v['others_match_id'] == $vv['match_id']){
-                        
                         $set_status = [
                             'status' => $vv['status'],
                             'is_rollball' => $vv['is_rollball'],
@@ -2023,6 +2022,11 @@ class WriteSportsController extends BaseController
                             // 新增 更新 赛事结果
                             $this->match_result($game_code, $v['match_id']);
                             
+                            // 更新 赛事结果表 状态 为已结束
+                            $ret_up_r = $model['model_result']::where(['match_id' => $v['match_id']])
+                            ->update(["status"=>2,'is_correct'=>-1,"update_time"=>date('Y-m-d H:i:s')]);
+                            if($ret_up_r < 1) throw new \Exception( Response::generate('',Response::ADD_MATCH_R_ERROR));
+
                             // 写入结算通知表 用于自动结算
                             $Comendnotice = new \App\Models\Comendnotice();
                             $ret_add = $Comendnotice->addcomendnotice($v['match_id'], $game_code, 0, $game_start_time);

+ 4 - 2
app/Lib/Settlement/SettlementAuto.php

@@ -106,8 +106,10 @@ class SettlementAuto
         $table1 = "st_" . $game_code . "_result";
         $table2 = "st_" . $game_code . "_competition";
 
-        DB::update("update $table1 set  status=3  where   match_id=$match_id ");
-        DB::update("update $table2 set  status=3  where   id=$match_id ");
+        $ret1 = DB::update("update $table1 set  status=3  where   match_id=$match_id ");
+        $ret2 = DB::update("update $table2 set  status=3  where   id=$match_id ");
+
+        Common::SET_NOMAM_RECORD('更赛事和结果改状态为3: ', ['game_code' => $game_code, 'match_id' => $match_id, 'ret1' => $ret1, 'ret2' => $ret2]);
 
         return true;
     }