lip 3 өдөр өмнө
parent
commit
6deb612ceb

+ 11 - 121
app/Console/Commands/Sport.php

@@ -107,17 +107,6 @@ class Sport extends Command
             $this->initOdds();
         }
     }
-    
-    //比赛开始后,超过3个小时,并且更新时间超过10分钟,还是进行中的数据,更新成已完成
-    public function updateOvertimeFixtures()
-    { 
-        // 比赛开始后,状态还是未开始的数据检测
-        $end_time = date("Y-m-d H:i:s", time() - 600);
-        SportModel::where('status', 1)->where('state', 1)->where('game_time', '<=', time() - 60*60*3)->where('updated_at', '<=', $end_time)->update(['state' =>2]);
-        // $ids = SportModel::where('status', 1)->where('state', 1)->where('game_time', '<=', time() - 60*60*3)->pluck('data_id')->get();
-        // print_r($ids);
-        return true;
-    }
 
     //到了比赛开始时间,但是状态还是未开始,检查比赛
     public function checkOvertimeFixtures()
@@ -201,8 +190,11 @@ class Sport extends Command
                 'is_send' => 0,
             ];
             
+            
+            $info = SportModel::where('data_id', $item['fixture']['id'])->first();
+            
             $fixture_status = null;
-            if (isset($item['fixture']['status']['long']) ) {
+            if (empty($info->is_roll) && isset($item['fixture']['status']['long']) ) {
                 $long = $item['fixture']['status']['long'];
                 if (isset($this->fixture_status[$long])) {
                     $fixture_status = json_encode($item['fixture']['status']);
@@ -238,7 +230,6 @@ class Sport extends Command
                 $sport_data['refund_status'] = 1;
             }
             
-            $info = SportModel::where('data_id', $item['fixture']['id'])->first();
             if (!$info) {
                 $sport_data['created_at'] = now();
                 $sport_data['status'] = 1;
@@ -367,14 +358,12 @@ class Sport extends Command
                     if ($info && (!$info->odd_name || $odd_name != $info->odd_name_en)) {
                         DB::table('sport_odds')->where('id', $info->id)->update([
                             'odd_name_en' => $odd_name,
-                            'odd_name' => $this->getZhName($odd_name),
                         ]);
                         echo '更新数据:'.$odd_id.'-'.$odd_name.PHP_EOL;
                     } elseif (!$info) {
                         DB::table('sport_odds')->insert([
                             'odd_id' => $odd_id,
                             'odd_name_en' => $odd_name,
-                            'odd_name' => $this->getZhName($odd_name),
                             'created_at' => date('Y-m-d H:i:s'),
                             'updated_at' => date('Y-m-d H:i:s'),
                         ]);
@@ -387,111 +376,12 @@ class Sport extends Command
         }
     }
 
-    public function getZhName ($name) {
-        $betting_terms = [
-            "Match Winner" => "全场胜负",
-            "Home/Away" => "主胜/客胜",
-            "Second Half Winner" => "下半场胜负",
-            "Asian Handicap" => "亚洲让球盘",
-            "Goals Over/Under" => "全场大小球",
-            "Goals Over/Under First Half" => "上半场大小球",
-            "Goals Over/Under - Second Half" => "下半场大小球",
-            "HT/FT Double" => "半场+全场双猜",
-            "Both Teams Score" => "双方均进球",
-            "Handicap Result" => "让球结果",
-            "Exact Score" => "精确比分",
-            "Correct Score - First Half" => "上半场精确比分",
-            "Correct Score - Second Half" => "下半场精确比分",
-            "Double Chance" => "双选胜平负",
-            "First Half Winner" => "上半场胜负",
-            "Team To Score First" => "首支进球球队",
-            "Team To Score Last" => "最后进球球队",
-            "Win Both Halves" => "上下半场均获胜",
-            "Total - Home" => "主队总进球数",
-            "Total - Away" => "客队总进球数",
-            "Both Teams Score - First Half" => "上半场双方均进球",
-            "Both Teams To Score - Second Half" => "下半场双方均进球",
-            "Odd/Even" => "总进球数奇偶",
-            "Odd/Even - First Half" => "上半场进球奇偶",
-            "Home Team Exact Goals Number" => "主队精确进球数",
-            "Away Team Exact Goals Number" => "客队精确进球数",
-            "Results/Both Teams Score" => "赛果+双方进球",
-            "Odd/Even - Second Half" => "下半场进球奇偶",
-            "Clean Sheet - Home" => "主队零封",
-            "Clean Sheet - Away" => "客队零封",
-            "Win to Nil - Home" => "主队零封获胜",
-            "Win to Nil - Away" => "客队零封获胜",
-            "Highest Scoring Half" => "进球更多的半场",
-            "Handicap Result - First Half" => "上半场让球结果",
-            "Asian Handicap First Half" => "上半场亚洲让球盘",
-            "Double Chance - First Half" => "上半场双选胜平负",
-            "Win To Nil" => "零封获胜",
-            "Home Odd/Even" => "主队进球奇偶",
-            "Away Odd/Even" => "客队进球奇偶",
-            "To Win Either Half" => "赢得任意半场",
-            "Result/Total Goals" => "赛果+总进球数",
-            "First 10 min Winner" => "前10分钟胜负",
-            "Corners Over Under" => "角球大小",
-            "Home Team Total Goals(1st Half)" => "主队上半场总进球",
-            "Away Team Total Goals(1st Half)" => "客队上半场总进球",
-            "Home Team Total Goals(2nd Half)" => "主队下半场总进球",
-            "Away Team Total Goals(2nd Half)" => "客队下半场总进球",
-            "Draw No Bet (1st Half)" => "上半场让球平注",
-            "European Handicap (2nd Half)" => "下半场欧洲让球",
-            "Draw No Bet (2nd Half)" => "下半场让球平注",
-            "Total Goals/Both Teams To Score" => "总进球+双方进球",
-            "Home Corners Over/Under" => "主队角球大小",
-            "Away Corners Over/Under" => "客队角球大小",
-            "Total Corners (3 way)" => "总角球三路",
-            "1x2 - 60 minutes" => "60分钟胜平负",
-            "1x2 - 30 minutes" => "30分钟胜平负",
-            "First Team to Score (3 way) 1st Half" => "上半场首支进球球队(三路)",
-            "Total Corners (1st Half)" => "上半场总角球",
-            "Corners. Odd/Even" => "角球奇偶",
-            "RTG_H1" => "上半场进球数(简写)",
-            "Cards Over/Under" => "黄牌大小",
-            "To Qualify" => "晋级球队",
-            "Goal Line" => "进球线",
-            "Goal Line (1st Half)" => "上半场进球线",
-            "Home team will score in both halves" => "主队上下半场均进球",
-            "Away team will score in both halves" => "客队上下半场均进球",
-            "Last Corner" => "最后角球",
-            "How many goals will Away Team score?" => "客队进球数",
-            "Asian Corners" => "亚洲让角球",
-            "Match Corners" => "全场角球",
-            "Final Score" => "最终比分",
-            "Match Goals" => "全场进球",
-            "Home Team Score a Goal (2nd Half)" => "主队下半场进球",
-            "Result / Both Teams To Score" => "赛果/双方进球",
-            "To Win 2nd Half" => "赢下半场",
-            "Over/Under Line" => "大小球盘口",
-            "3-Way Handicap" => "三路让球",
-            "Away Team Goals" => "客队进球",
-            "Both Teams To Score (2nd Half)" => "下半场双方进球",
-            "Which team will score the 5th corner? (2 Way)" => "第5个角球归属(二路)",
-            "Race to the 9th corner?" => "先得9个角球",
-            "Race to the 7th corner?" => "先得7个角球",
-            "Draw No Bet" => "让球平注",
-            "Home Team Goals" => "主队进球",
-            "Total Corners" => "总角球",
-            "Fulltime Result" => "全场赛果",
-            "Race to the 5th corner?" => "先得5个角球",
-            "Last Team to Score (3 way)" => "最后进球球队(三路)",
-            "Which team will score the 2nd goal?" => "第二球归属球队",
-            "Home Team Clean Sheet" => "主队零封",
-            "How many goals will Home Team score?" => "主队进球数",
-            "Goals Odd/Even" => "进球奇偶",
-            "Both Teams to Score" => "双方均进球",
-            "Away Team Score a Goal (2nd Half)" => "客队下半场进球",
-            "Which team will score the 4th goal?" => "第四球归属球队",
-            "Which team will score the 7th corner? (2 Way)" => "第7个角球归属(二路)",
-        ];
-
-        if (isset($betting_terms[$name])) {
-            return $betting_terms[$name];
-        }
-        return '';
+    //比赛开始后,超过3个小时,并且更新时间超过10分钟,还是进行中的数据,更新成已完成
+    public function updateOvertimeFixtures()
+    { 
+        // 比赛开始后,状态还是未开始的数据检测
+        $end_time = date("Y-m-d H:i:s", time() - 600);
+        SportModel::where('status', 1)->where('state', 1)->where('game_time', '<=', time() - 60*60*3)->where('updated_at', '<=', $end_time)->update(['state' =>2]);
+        return true;
     }
-
-
 }

+ 0 - 4
app/Console/Commands/SportOdds.php

@@ -86,9 +86,6 @@ class SportOdds extends Command
             //直播赔率(获取正在直播的所有赛事的赔率)
             if ($is_live == 1) {
                 $data = SportClientService::oddsLive([]);
-                // $data = SportClientService::oddsLive(['fixture' => '1537245']);
-                // die;
-                    
                 // file_put_contents("oddsLive.json",json_encode($data));
                 $this->updateOddsLive($data);
             } else {
@@ -175,7 +172,6 @@ class SportOdds extends Command
             SportModel::where('data_id',$data_id)->update(['odds' => json_encode($odds), 'is_send' => 0]);
         } else {
             echo "更新失败\r\n";
-            file_put_contents('odds-error.log', json_encode($data)."\r\n\r\n", FILE_APPEND);
         }
     }
 

+ 4 - 0
app/Http/Controllers/admin/Order.php

@@ -11,6 +11,9 @@ use Illuminate\Support\Facades\DB;
 use App\Constants\HttpStatus;
 use App\Models\Wallet;
 
+/**
+ * 足球订单
+ */
 class Order extends Controller
 {
     /**
@@ -73,6 +76,7 @@ class Order extends Controller
                 'id' => ['nullable', 'string'],
                 'user_id' => ['nullable', 'string'],
                 'order_id' => ['nullable', 'string'],
+                'issue' => ['nullable', 'integer'],
                 'pay_status' => ['nullable', 'integer', 'in:0,1'],
                 'is_win' => ['nullable', 'integer', 'in:0,1'],
                 'is_roll' => ['nullable', 'integer', 'in:0,1'],