Ken 6 giorni fa
parent
commit
24f6d8ab9a
2 ha cambiato i file con 5 aggiunte e 7 eliminazioni
  1. 1 6
      app/Services/BetService.php
  2. 4 1
      app/Services/IssueService.php

+ 1 - 6
app/Services/BetService.php

@@ -423,18 +423,13 @@ class BetService extends BaseService
 
                 $now_date = date('Y-m-d H:i:s', time() + 38); // 提前45秒
                 if ($issueInfo['end_time'] > $now_date) {
-
-
                     $fake_bet_list = Cache::get('fake_bet_' . $issueInfo->issue_no, []);
-
                     $gameplayRuleList = GameplayRuleService::model()::where('odds', '>', 0)->get();
                     $gameplayRuleList = $gameplayRuleList->toArray();
                     $member_id = self::generateRandomNumber(10);
                     $betTimes = rand(1, $betNumber); // 每次下注次数
-
-
                     for ($i = 0; $i < $betTimes; $i++) {
-                        if (strtotime($issueInfo['end_time']) - time() < 60) {
+                        if (strtotime($issueInfo['end_time']) - time() < IssueService::COUNTDOWN_TO_CLOSING_THE_MARKET) {
                             $fake_bet_count = Cache::get("fake_bet_count_{$issueInfo->issue_no}", 0);
                             if ($fake_bet_count >= 3) return;
                         }

+ 4 - 1
app/Services/IssueService.php

@@ -29,6 +29,9 @@ use App\Jobs\SendTelegramGroupMessageJob;
  */
 class IssueService extends BaseService
 {
+
+    const COUNTDOWN_TO_CLOSING_THE_MARKET = 60;
+
     /**
      * @description: 模型
      * @return {string}
@@ -973,7 +976,7 @@ class IssueService extends BaseService
     {
         $info = self::model()::where('status', self::model()::STATUS_BETTING)->orderBy('end_time', 'asc')->first();
         if ($info) {
-            $now_date = date('Y-m-d H:i:s', time() + 60); // 提前60秒
+            $now_date = date('Y-m-d H:i:s', time() + IssueService::COUNTDOWN_TO_CLOSING_THE_MARKET);
             if ($info['end_time'] < $now_date) {
                 $replyInfo = KeyboardService::findOne(['button' => '封盘倒数']);
                 if ($replyInfo) {