|
|
@@ -30,6 +30,12 @@ class QianBaoWithdrawService
|
|
|
$telegram->editMessageText($res);
|
|
|
}
|
|
|
|
|
|
+ $pattern = "/^withdraw@@qb_choose_.*$/";
|
|
|
+ if (preg_match($pattern, $data)) {
|
|
|
+ $type = preg_replace('/^withdraw@@qb_choose_/', '', $data);
|
|
|
+ $res = QianBaoWithdrawService::showBanks($chatId, $messageId, $type);
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
if ($data === "withdraw@@qb_apply") {
|
|
|
$res = QianBaoWithdrawService::qbApply($chatId, $messageId);
|
|
|
@@ -136,16 +142,52 @@ class QianBaoWithdrawService
|
|
|
$keyboard[] = [
|
|
|
['text' => "提现账户管理", 'callback_data' => "withdraw@@banks"],
|
|
|
];
|
|
|
+ return [
|
|
|
+ 'chat_id' => $chatId,
|
|
|
+ 'text' => "请选择提现方式",
|
|
|
+ 'message_id' => $messageId,
|
|
|
+ 'reply_markup' => json_encode(['inline_keyboard' => $keyboard])
|
|
|
+ ];
|
|
|
+ }
|
|
|
+
|
|
|
+ private static function showBanks($chatId, $messageId, $type)
|
|
|
+ {
|
|
|
+ $channel = '';
|
|
|
+ switch ($type) {
|
|
|
+ case "bank":
|
|
|
+ $text = "请选择提现的银行卡";
|
|
|
+ $channel = 'DF001';
|
|
|
+ break;
|
|
|
+ case "aliPay":
|
|
|
+ $text = "请选择提现的支付宝";
|
|
|
+ $channel = "DF002";
|
|
|
+ break;
|
|
|
+ case "digital_RMB":
|
|
|
+ $text = "暂不支持数字人民币";
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ $list = Bank::where('channel', $channel)->get();
|
|
|
|
|
|
|
|
|
+ $keyboard = [];
|
|
|
+ foreach ($list as $item) {
|
|
|
+ $keyboard[] = [['text' => "{$item->alias}", 'callback_data' => "withdrawAddress@@bank_detail{$item->id}"]];
|
|
|
+ }
|
|
|
+ if (count($list) < 5) {
|
|
|
+ $keyboard[] = [['text' => "➕ 添加", 'callback_data' => "withdrawAddress@@bank_add"]];
|
|
|
+ }
|
|
|
+ $keyboard[] = [['text' => "↩️返回", 'callback_data' => "topUp@@home"]];
|
|
|
return [
|
|
|
'chat_id' => $chatId,
|
|
|
- 'text' => "请选择提现方式",
|
|
|
+ 'text' => $text,
|
|
|
'message_id' => $messageId,
|
|
|
'reply_markup' => json_encode(['inline_keyboard' => $keyboard])
|
|
|
];
|
|
|
+
|
|
|
+
|
|
|
}
|
|
|
|
|
|
+
|
|
|
//钱宝账单
|
|
|
private static function bill($chatId, $firstName, $messageId, $page = 1, $limit = 5)
|
|
|
{
|