Ken 1 day ago
parent
commit
2f603e5f2e
2 changed files with 26 additions and 13 deletions
  1. 1 1
      app/Services/IssueService.php
  2. 25 12
      app/Services/PcIssueService.php

+ 1 - 1
app/Services/IssueService.php

@@ -234,7 +234,7 @@ class IssueService extends BaseService
                 $image = url($image);
             }
             // self::bettingGroupNotice($text, $buttons, $image);
-            self::asyncBettingGroupNotice($text, $buttons, $image);
+            if ($pc28Switch == 0) self::asyncBettingGroupNotice($text, $buttons, $image);
         }
 
 

+ 25 - 12
app/Services/PcIssueService.php

@@ -36,23 +36,36 @@ class PcIssueService extends BaseService
             ->get();
         $now = time();
         $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);
-            }
-        }
+
 
         foreach ($list as $index => $item) {
             if (strtotime($item->end_time) - 30 <= $now) {
                 $item->status = PcIssue::STATUS_CLOSE;
                 $item->save();
-                if ($replyInfo && $pc28Switch == 1 && $index == 0) self::asyncBettingGroupNotice($text, $buttons, $image);
-                // 统计投注情况通知
-                if ($pc28Switch == 1 && $index == 0) BetService::statNotice($item->issue_no);
+
+                if ($index == 0 && $pc28Switch == 1) {
+                    $replyInfo = KeyboardService::findOne(['button' => '停止下注']);
+                    if ($replyInfo) {
+                        $text = $replyInfo->reply;
+                        $buttons = json_decode($replyInfo->buttons, true);
+                        $image = $replyInfo->image;
+                        if ($image) $image = url($image);
+                        self::asyncBettingGroupNotice($text, $buttons, $image);
+                    }
+
+                    // 统计投注情况通知
+                    BetService::statNotice($item->issue_no);
+                    $replyInfo = KeyboardService::findOne(['button' => '封盘开奖']);
+                    if ($replyInfo) {
+                        $text = $replyInfo->reply;
+                        $buttons = json_decode($replyInfo->buttons, true);
+                        $image = $replyInfo->image;
+                        if ($image) $image = url($image);
+                        self::asyncBettingGroupNotice($text, $buttons, $image);
+                    }
+                }
+
+
             }
         }
     }