Ken il y a 1 jour
Parent
commit
b33a1d59e7
2 fichiers modifiés avec 7 ajouts et 7 suppressions
  1. 1 0
      app/Http/Controllers/api/Home.php
  2. 6 7
      app/Services/IssueService.php

+ 1 - 0
app/Http/Controllers/api/Home.php

@@ -81,6 +81,7 @@ class Home extends Controller
 
     public function test()
     {
+        IssueService::syncCloseIssue();
         $result = IssueService::getLatestIssue();
 
 

+ 6 - 7
app/Services/IssueService.php

@@ -161,9 +161,8 @@ class IssueService extends BaseService
         $info->status = self::model()::STATUS_BETTING;
         $info->save();
 
-        // $text = "";
-        // $text .= "第".$info->issue_no."期\n";
-        // $text .= "🔥🔥🔥🔥🔥开始下注🔥🔥🔥🔥🔥\n";
+
+        $pc28Switch = Config::where('field', 'pc28_switch')->first()->val;
         $replyInfo = KeyboardService::findOne(['button' => '玩法规则']);
         if ($replyInfo) {
             $text = $replyInfo->reply;
@@ -175,7 +174,8 @@ class IssueService extends BaseService
             if (empty($buttons)) {
                 $buttons = self::getOperateButton();
             }
-            self::asyncBettingGroupNotice($text, $buttons, $image);
+
+            if ($pc28Switch == 0)  self::asyncBettingGroupNotice($text, $buttons, $image);
         }
 
         $replyInfo = KeyboardService::findOne(['button' => '开始下注']);
@@ -186,7 +186,7 @@ class IssueService extends BaseService
             if ($image) {
                 $image = url($image);
             }
-            self::asyncBettingGroupNotice($text, $buttons, $image);
+            if ($pc28Switch == 0)  self::asyncBettingGroupNotice($text, $buttons, $image);
         }
 
         return ['code' => self::YES, 'msg' => '开始下注'];
@@ -874,8 +874,7 @@ class IssueService extends BaseService
 
                 $id = $res['key'] ?? 0;
                 if ($id) {
-                    $pc28Switch = Config::where('field', 'pc28_switch')->first()->val;
-                    if ($pc28Switch == 0) self::betting($id); // 开始下注
+                   self::betting($id); // 开始下注
 
                 }
                 Cache::set('new_issue_no', $new_issue_no, 10); // 缓存