seven 2 tuần trước cách đây
mục cha
commit
01a90d0c90
2 tập tin đã thay đổi với 5 bổ sung3 xóa
  1. 3 2
      app/Jobs/SendTelegramMessageJob.php
  2. 2 1
      app/Services/BetService.php

+ 3 - 2
app/Jobs/SendTelegramMessageJob.php

@@ -28,8 +28,9 @@ class SendTelegramMessageJob implements ShouldQueue
      * @param array $buttons
      * @param string|null $image
      */
-    public function __construct( $text, $buttons = [], $image = null ,$isTop = false)
+    public function __construct($chatId, $text, $buttons = [], $image = null ,$isTop = false)
     {
+        $this->chatId = $chatId;
         $this->text = $text;
         $this->buttons = $buttons;
         $this->image = $image;
@@ -39,7 +40,7 @@ class SendTelegramMessageJob implements ShouldQueue
     public function handle()
     {
         try {
-            BaseService::bettingGroupNotice($this->text, $this->buttons, $this->image,$this->isTop);
+            BaseService::sendMessage($this->chatId ,$this->text, $this->buttons, $this->image);
         } catch (\Telegram\Bot\Exceptions\TelegramResponseException $e) {
             // 捕获 Too Many Requests
             if (str_contains($e->getMessage(), 'Too Many Requests')) {

+ 2 - 1
app/Services/BetService.php

@@ -891,7 +891,8 @@ class BetService extends BaseService
                 $text2 .= "中奖金额:{$v['win_amount']} \n";
                 $text2 .= "派彩金额:{$profit} \n";
                 $text2 .= "盈亏金额:{$yl} \n";
-                self::sendMessage($v['member_id'],$text2);
+                SendTelegramMessageJob::dispatch($v['member_id'],$text2);
+                // self::sendMessage($v['member_id'],$text2);
             // }else{
             //     $text .= "会员下注 【" . $v['lastStr'] . "】 {$amount} 0 -{$amount}\n";
             // }