seven hai 2 días
pai
achega
984410af9d

+ 58 - 1
app/Http/Controllers/api/TelegramWebHook.php

@@ -102,7 +102,7 @@ class TelegramWebHook extends Controller
                     BetService::alertNotice($callbackId , $alertText);
                 }
 
-                                //点击充值按钮
+                //点击充值按钮
                 if ($data === 'topup@@topup') {
                     $telegram->deleteMessage([
                         'chat_id' => $chatId,
@@ -172,6 +172,63 @@ class TelegramWebHook extends Controller
                     // }
                 }
 
+
+                //点击提现按钮
+                if ($data === "withdraw@@apply") {
+                    $res = (new WithdrawService())->apply($chatId, $messageId);
+                    $telegram->editMessageText($res);
+                }
+
+                //地址管理
+                if ($data === 'withdraw@@address') {
+                    $res = WithdrawService::getAddress($chatId, $messageId);
+                    $telegram->editMessageText($res);
+                }
+
+
+
+                //关闭本条消息
+                if ($data === 'message@@close') {
+                    $telegram->deleteMessage([
+                        'chat_id' => $chatId,
+                        'message_id' => $messageId
+                    ]);
+                }
+
+                if ($data === 'withdrawAddress@@add') {
+                    $res = WithdrawService::addAddress($chatId, $messageId);
+                    $telegram->editMessageText($res);
+                }
+
+                //提现管理
+                if ($data === "withdraw@@home") {
+                    // $res = WithdrawService::index($chatId, $firstName, $messageId);
+                    // $telegram->editMessageText($res);
+                    $telegram->deleteMessage([
+                        'chat_id' => $chatId,
+                        'message_id' => $messageId
+                    ]);
+                    $returnMsg = WalletService::getBalance($chatId);
+                    if($returnMsg){
+                        $this->telegram->sendMessage($returnMsg);
+                    }
+                }
+
+                //点击提现的账单按钮
+                if ($data === "withdraw@@bill") {
+                    $res = (new WithdrawService())->bill($chatId, $firstName, $messageId);
+                    $telegram->editMessageText($res);
+//                    $telegram->sendMessage($res);
+//                    $text = "📅 请输入查询日期\n";
+//                    $date = date('Y-m-d');
+//                    $text .= "例如您要查询的日期 {$date}\n";
+//                    $text .= "那么请发送:【提现账单】{$date}\n";
+//                    $telegram->sendMessage([
+//                        'chat_id' => $chatId,
+//                        'text' => $text
+//                    ]);
+                }
+
                 //充值账单,下一页
                 $pattern = "/^topUpBillNextPage@@\d+$/";
                 if (preg_match($pattern, $data)) {

+ 5 - 1
app/Services/WalletService.php

@@ -241,7 +241,11 @@ class WalletService extends BaseService
         $keyboard = [
             [
                 ['text' => '➕充值', 'callback_data' => "topup@@topup"],
-                ['text' => '🧾账单', 'callback_data' => "topup@@bill"],
+                ['text' => '🧾充值账单', 'callback_data' => "topup@@bill"],
+            ],
+            [
+                ['text' => '➕ 提现', 'callback_data' => "withdraw@@apply"],
+                ['text' => '🧾 提现账单', 'callback_data' => "withdraw@@bill"]
             ]
         ];