seven 1 周之前
父節點
當前提交
4a117712af
共有 2 個文件被更改,包括 18 次插入3 次删除
  1. 8 3
      app/Services/BaseService.php
  2. 10 0
      app/Services/BetService.php

+ 8 - 3
app/Services/BaseService.php

@@ -130,12 +130,17 @@ class BaseService
      * @param {*} $key
      * @return {*}
      */    
-    public static function bettingGroupNotice($text)
+    public static function bettingGroupNotice($text ,$keyboard = [])
     {
         $bettingGroup = Config::where('field', 'betting_group')->first()->val;
-        self::telegram()->sendMessage([
+
+        $botMsg = [
             'chat_id' => "@{$bettingGroup}",
             'text' => $text
-        ]);
+        ];
+        if($keyboard){
+            $botMsg['reply_markup'] = json_encode(['inline_keyboard' => $keyboard]);
+        }
+        self::telegram()->sendMessage($botMsg);
     }
 }

+ 10 - 0
app/Services/BetService.php

@@ -238,6 +238,16 @@ class BetService extends BaseService
         $text .= "--------\n";
         $text .= "下注成功\n";
         $msg['text'] = $text;
+
+        $groupText = "";
+        $groupText .= "私聊下注 【xxxxxx】 \n";
+        $groupText .= "下注期数:{$issueInfo->issue_no} \n";
+        $groupText .= "下注内容: \n";
+        $groupText .= "----------- \n";
+        $groupText .= "{$input} \n";
+        $groupText .= "----------- \n";
+        self::bettingGroupNotice($groupText);   // 群通知
+
         return $msg;
     }