vali 6 年之前
父節點
當前提交
1a31ce6ff0
共有 1 個文件被更改,包括 17 次插入1 次删除
  1. 17 1
      app/Logic/DataLogic.php

+ 17 - 1
app/Logic/DataLogic.php

@@ -199,6 +199,17 @@ class DataLogic
             if (!empty($match_r_data)) {
                 foreach ($match_r_data as $k => $v) {
                     $del = $models['model_result_express']::where('match_id', $v['match_id'])->delete();
+
+                    //==处理 赛事时间==
+                    // dd($v['match_date'].' '.$v['match_time']);
+                    $match_time_o = strtotime($v['match_date'] . ' ' . $v['match_time']);//原始美东时间 时间戳
+                    $match_time_new = strtotime(commonFunction::qgmdate('Y-m-d H:i:s', $match_time_o, 20));//本地时间 时间戳 20=8+12
+                    $match_date = date('Y-m-d', $match_time_new);
+                    $match_time = date('H:i:s', $match_time_new);
+                    //==end==
+
+                    $v['match_date'] = $match_date;
+                    $v['match_time'] = $match_time;
                     $v['c_time'] = date('Y-m-d H:i:s', time());
                     $v['u_time'] = date('Y-m-d H:i:s', time());
                     $v['source'] = $source;
@@ -370,6 +381,11 @@ class DataLogic
                     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']])
+                                ->update(['status' => 6, 'handle_mark' => '重复赛事取消']);
+                            //===end====
                             $half_match_id = $v['half_match_id'];
                             //获取 本地 联赛 ID
                             //验证本赛事是否有数据源lg_id
@@ -980,7 +996,7 @@ class DataLogic
             $model = commonFunction::getModels($game_code, 1);
             //获取所有赛事 match_id
             $local_match = $model['model_local_match']::SELECT('others_match_id', 'match_id')
-                ->where(['source' => $source])
+                //->where(['source' => $source])
                 ->whereIn('identity', $match_uuids)
                 ->get()->toArray();
             if (empty($local_match)) throw new \Exception(Response::generate('', Response::MATCHID_NULL));