seven 6 dagen geleden
bovenliggende
commit
721ef8b5af
3 gewijzigde bestanden met toevoegingen van 33 en 18 verwijderingen
  1. 27 0
      app/Services/BaseService.php
  2. 3 18
      app/Services/BetService.php
  3. 3 0
      app/Services/IssueService.php

+ 27 - 0
app/Services/BaseService.php

@@ -174,4 +174,31 @@ class BaseService
     {
         Log::error($message, $context);
     }
+
+    /**
+     * @description: 获取操作按钮
+     * @return {*}
+     */
+    public static function getOperateButton()
+    {
+        $username = config('services.telegram.username');
+        $serviceAccount = Config::where('field', 'service_account')->first()->val;
+        $officialChannel = Config::where('field', 'official_channel')->first()->val;
+        $inlineButton = [];
+        $inlineButton[] = [
+            ['text' => "查看余额", 'callback_data' => 'balanceAlert'],
+            ['text' => "✅唯一财务", 'url' => "https://t.me/{$serviceAccount}"]
+        ];
+        $inlineButton[] = [
+            ['text' => "近期注单", 'callback_data' => 'betsAlert'],
+            ['text' => "今日流水", 'callback_data' => 'todayFlowAlert']
+        ];
+        $inlineButton[] = [
+            ['text' => "私聊下注", 'url' => "https://t.me/{$username}"]
+        ];
+        $inlineButton[] = [
+            ['text' => "官方频道", 'url' => "https://t.me/{$officialChannel}"]
+        ];
+        return $inlineButton;
+    }
 }

+ 3 - 18
app/Services/BetService.php

@@ -247,24 +247,9 @@ class BetService extends BaseService
         $groupText .= "{$input} \n";
         $groupText .= "----------- \n";
 
-        $username = config('services.telegram.username');
-        $serviceAccount = Config::where('field', 'service_account')->first()->val;
-        $officialChannel = Config::where('field', 'official_channel')->first()->val;
-        $inlineButton = [];
-        $inlineButton[] = [
-            ['text' => "查看余额", 'callback_data' => 'balanceAlert'],
-            ['text' => "✅唯一财务", 'url' => "https://t.me/{$serviceAccount}"]
-        ];
-        $inlineButton[] = [
-            ['text' => "近期注单", 'callback_data' => 'betsAlert'],
-            ['text' => "今日流水", 'callback_data' => 'todayFlowAlert']
-        ];
-        $inlineButton[] = [
-            ['text' => "私聊下注", 'url' => "https://t.me/{$username}"]
-        ];
-        $inlineButton[] = [
-            ['text' => "官方频道", 'url' => "https://t.me/{$officialChannel}"]
-        ];
+        
+        $inlineButton = self::getOperateButton();
+        
          // 群通知
         self::bettingGroupNotice($groupText,$inlineButton);   // 群通知
 

+ 3 - 0
app/Services/IssueService.php

@@ -167,6 +167,9 @@ class IssueService extends BaseService
             if($image){
                 $image = url($image);
             }
+            if(empty($buttons)){
+                $buttons = self::getOperateButton();
+            }
             self::bettingGroupNotice($text, $buttons, $image);
         }
         return ['code'=>self::YES, 'msg'=>'开始下注'];