Ken 6 gün önce
ebeveyn
işleme
74db2c946b
2 değiştirilmiş dosya ile 20 ekleme ve 14 silme
  1. 17 13
      app/Services/IssueService.php
  2. 3 1
      app/Services/PcIssueService.php

+ 17 - 13
app/Services/IssueService.php

@@ -163,21 +163,25 @@ class IssueService extends BaseService
 
 
         $pc28Switch = Config::where('field', 'pc28_switch')->first()->val;
-        $replyInfo = KeyboardService::findOne(['button' => '玩法规则']);
-        if ($replyInfo) {
-            $text = $replyInfo->reply;
-            $buttons = json_decode($replyInfo->buttons, true);
-            $image = $replyInfo->image;
-            if ($image) {
-                $image = url($image);
-            }
-            if (empty($buttons)) {
-                $buttons = self::getOperateButton();
-            }
 
-            if ($pc28Switch == 0) self::asyncBettingGroupNotice($text, $buttons, $image);
+        $wanFaGuiZeTime = Cache::get("玩法规则推送时间");
+        $now = time();
+        if ($now - $wanFaGuiZeTime > (60 * 15)) {
+            $replyInfo = KeyboardService::findOne(['button' => '玩法规则']);
+            if ($replyInfo) {
+                $text = $replyInfo->reply;
+                $buttons = json_decode($replyInfo->buttons, true);
+                $image = $replyInfo->image;
+                if ($image) {
+                    $image = url($image);
+                }
+                if (empty($buttons)) {
+                    $buttons = self::getOperateButton();
+                }
+                Cache::put('玩法规则推送时间', time());
+                if ($pc28Switch == 0) self::asyncBettingGroupNotice($text, $buttons, $image);
+            }
         }
-
         $replyInfo = KeyboardService::findOne(['button' => '开始下注']);
         if ($replyInfo) {
             $text = $replyInfo->reply;

+ 3 - 1
app/Services/PcIssueService.php

@@ -314,9 +314,11 @@ class PcIssueService extends BaseService
         if (!in_array($info->status, [PcIssue::STATUS_DRAFT, PcIssue::STATUS_BETTING])) {
             return;
         }
-        $pc28Switch = Config::where('field', 'pc28_switch')->first()->val;
         $info->status = PcIssue::STATUS_BETTING;
         $info->save();
+
+
+        $pc28Switch = Config::where('field', 'pc28_switch')->first()->val;
         $wanFaGuiZeTime = Cache::get("玩法规则推送时间");
         $now = time();
         if ($now - $wanFaGuiZeTime > (60 * 15)) {