Ken 2 долоо хоног өмнө
parent
commit
898e6b1109

+ 7 - 6
app/Services/PcIssueService.php

@@ -39,6 +39,7 @@ class PcIssueService extends BaseService
         if ($info) {
         if ($info) {
             $now_date = date('Y-m-d H:i:s', time() + 60); // 提前60秒
             $now_date = date('Y-m-d H:i:s', time() + 60); // 提前60秒
             if ($info['end_time'] < $now_date) {
             if ($info['end_time'] < $now_date) {
+                $maintenanceSwitch = Config::where('field', 'maintenance_switch')->first()->val;
                 $replyInfo = KeyboardService::findOne(['button' => '封盘倒数']);
                 $replyInfo = KeyboardService::findOne(['button' => '封盘倒数']);
                 if ($replyInfo) {
                 if ($replyInfo) {
                     $text = $replyInfo->reply;
                     $text = $replyInfo->reply;
@@ -51,7 +52,7 @@ class PcIssueService extends BaseService
 
 
                     } else {
                     } else {
                         $pc28Switch = Config::where('field', 'pc28_switch')->first()->val;
                         $pc28Switch = Config::where('field', 'pc28_switch')->first()->val;
-                        if ($pc28Switch == 1) {
+                        if ($maintenanceSwitch !=1 && $pc28Switch == 1) {
                             self::asyncBettingGroupNotice($text, $buttons, $image);
                             self::asyncBettingGroupNotice($text, $buttons, $image);
                             Cache::put('issue_countdown_' . $info->issue_no, true, 60); // 缓存50秒,防止多次发送
                             Cache::put('issue_countdown_' . $info->issue_no, true, 60); // 缓存50秒,防止多次发送
                         }
                         }
@@ -113,9 +114,9 @@ class PcIssueService extends BaseService
             if (strtotime($item->end_time) <= $now) {
             if (strtotime($item->end_time) <= $now) {
                 DB::beginTransaction();
                 DB::beginTransaction();
                 try {
                 try {
-                    if(!empty($item->advance_keno)){
+                    if (!empty($item->advance_keno)) {
                         $keno = json_decode($item->advance_keno, true);
                         $keno = json_decode($item->advance_keno, true);
-                    }else{
+                    } else {
                         $keno = static::getKeno();
                         $keno = static::getKeno();
                     }
                     }
                     $item->keno = json_encode($keno);
                     $item->keno = json_encode($keno);
@@ -325,7 +326,7 @@ class PcIssueService extends BaseService
         $info->status = PcIssue::STATUS_BETTING;
         $info->status = PcIssue::STATUS_BETTING;
         $info->save();
         $info->save();
 
 
-
+        $maintenanceSwitch = Config::where('field', 'maintenance_switch')->first()->val;
         $pc28Switch = Config::where('field', 'pc28_switch')->first()->val;
         $pc28Switch = Config::where('field', 'pc28_switch')->first()->val;
         $wanFaGuiZeTime = Cache::get("玩法规则推送时间", 0);
         $wanFaGuiZeTime = Cache::get("玩法规则推送时间", 0);
         $now = time();
         $now = time();
@@ -342,7 +343,7 @@ class PcIssueService extends BaseService
                     $buttons = self::getOperateButton();
                     $buttons = self::getOperateButton();
                 }
                 }
                 Cache::put('玩法规则推送时间', time());
                 Cache::put('玩法规则推送时间', time());
-                if ($pc28Switch == 1) self::asyncBettingGroupNotice($text, $buttons, $image);
+                if ($maintenanceSwitch != 1 && $pc28Switch == 1) self::asyncBettingGroupNotice($text, $buttons, $image);
             }
             }
         }
         }
         $replyInfo = KeyboardService::findOne(['button' => '开始下注']);
         $replyInfo = KeyboardService::findOne(['button' => '开始下注']);
@@ -353,7 +354,7 @@ class PcIssueService extends BaseService
             if ($image) {
             if ($image) {
                 $image = url($image);
                 $image = url($image);
             }
             }
-            if ($pc28Switch == 1) self::asyncBettingGroupNotice($text, $buttons, $image);
+            if ($maintenanceSwitch != 1 && $pc28Switch == 1) self::asyncBettingGroupNotice($text, $buttons, $image);
         }
         }
 
 
     }
     }