vali 6 년 전
부모
커밋
c9480862bc
1개의 변경된 파일30개의 추가작업 그리고 13개의 파일을 삭제
  1. 30 13
      app/Logic/DataLogic.php

+ 30 - 13
app/Logic/DataLogic.php

@@ -857,6 +857,7 @@ class DataLogic
             //获取待更新赛事
             $obt = $data['data'];
 
+            //请求 数据 为空
             if (empty($obt)) throw new \Exception(Response::generate('请求数据为空,', Response::ABNORMAL));
             $data = $this->getAddData($obt);
             //不是 直播 数据
@@ -889,19 +890,35 @@ class DataLogic
                 ->get()->toArray();
             if (empty($local_match)) throw new \Exception(Response::generate('', Response::MATCHID_NULL));
             //更新状态字段
-            foreach ($local_match as $k => $v) {
-                $set_status = [
-                    'status' => $v['status'],
-                    'is_rollball' => $v['is_rollball'],
-                    'is_today' => $v['is_today'],
-                    'is_morningplate' => $v['is_morningplate'],
-                    'is_stringscene' => $v['is_stringscene'],
-                    'is_horn' => $v['is_horn'],
-                    'utime' => date('Y-m-d H:i:s'),
-                ];
-                $ret = $model['model_match']::where(['id' => $v['match_id']])
-                    ->update($set_status);
-                if ($ret < 1) throw new \Exception(Response::generate(gameModel::getGameName($game_code) . '赛事-match_id:' . $v['others_match_id'], Response::UPSTATUS_ERROR));
+            if($game_code == 'zq'){
+                foreach ($local_match as $k => $v) {
+                    $set_status = [
+                        'status' => $v['status'],
+                        'is_rollball' => $v['is_rollball'],
+                        'is_today' => $v['is_today'],
+                        'is_morningplate' => $v['is_morningplate'],
+                        'is_stringscene' => $v['is_stringscene'],
+                        'is_horn' => $v['is_horn'],
+                        'utime' => date('Y-m-d H:i:s'),
+                    ];
+                    $ret = $model['model_match']::where(['id' => $v['match_id']])
+                        ->update($set_status);
+                    if ($ret < 1) throw new \Exception(Response::generate(gameModel::getGameName($game_code) . '赛事-match_id:' . $v['others_match_id'], Response::UPSTATUS_ERROR));
+                }
+            }else{
+                foreach ($local_match as $k => $v) {
+                    $set_status = [
+                        'status' => $v['status'],
+                        'is_rollball' => $v['is_rollball'],
+                        'is_today' => $v['is_today'],
+                        'is_morningplate' => $v['is_morningplate'],
+                        'is_stringscene' => $v['is_stringscene'],
+                        'utime' => date('Y-m-d H:i:s'),
+                    ];
+                    $ret = $model['model_match']::where(['id' => $v['match_id']])
+                        ->update($set_status);
+                    if ($ret < 1) throw new \Exception(Response::generate(gameModel::getGameName($game_code) . '赛事-match_id:' . $v['others_match_id'], Response::UPSTATUS_ERROR));
+                }
             }
 
             $this->writeLog($sdata, Response::success());