seven 2 сар өмнө
parent
commit
2d60e5b42d

+ 49 - 17
app/Services/BaseService.php

@@ -219,24 +219,56 @@ class BaseService
      */
     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??'';
+
+        $replyInfo = KeyboardService::findOne(['button' => '投注菜单']);
+        if($replyInfo && $replyInfo->buttons){
+            $buttons = json_decode($replyInfo->reply, true);
+
+           foreach ($buttons as $row) {
+                $inlineButton[] = [];
+                foreach ($row as $button) {
+                    $btn = ['text' => $button['text']];
+                    if(strpos($button['url'], 'http') === 0){
+                        $btn['url'] = $button['url'];
+                    }else{
+                        $btn['callback_data'] = $button['url'];
+                    }
+                    $inlineButton[count($inlineButton) - 1][] = $btn;
+                    // if (isset($button['text'])) {
+                    //     $btn = ['text' => $button['text']];
+                    //     if (isset($button['callback_data'])) {
+                    //         $btn['callback_data'] = $button['callback_data'];
+                    //     }
+                    //     if (isset($button['url'])) {
+                    //         $btn['url'] = $button['url'];
+                    //     }
+                    //     $inlineButton[count($inlineButton) - 1][] = $btn;
+                    // }
+                }
+            }
+            $inlineButton = array_values($inlineButton);
+            return $inlineButton;
+           
+
+        }
+        // $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[] = [
+        //     ['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;
     }
 

+ 2 - 2
app/Services/BetService.php

@@ -334,7 +334,7 @@ class BetService extends BaseService
         $lastStr = self::hideMiddleDigits($userInfo->member_id, 4);
 
         $groupText = "";
-        $groupText .= "私聊下注 【" . $lastStr . "】 \n";
+        $groupText .= "会员下注 【" . $lastStr . "】 \n";
         $groupText .= "下注期数:{$issueInfo->issue_no} \n";
         $groupText .= "下注内容: \n";
         $groupText .= "----------- \n";
@@ -403,7 +403,7 @@ class BetService extends BaseService
                         $lastStr = self::hideMiddleDigits($item['member_id'], 4);
 
                         $groupText = "";
-                        $groupText .= "私聊下注 【" . $lastStr . "】 \n";
+                        $groupText .= "会员下注 【" . $lastStr . "】 \n";
                         $groupText .= "下注期数:{$issueInfo->issue_no} \n";
                         $groupText .= "下注内容: \n";
                         $groupText .= "----------- \n";