|
|
@@ -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;
|
|
|
}
|
|
|
|