|
|
@@ -92,7 +92,6 @@ class QianBaoWithdrawService
|
|
|
// }
|
|
|
|
|
|
|
|
|
-
|
|
|
//银行卡详情
|
|
|
$pattern = "/^withdrawAddress@@bank_detail\d+$/";
|
|
|
if (preg_match($pattern, $data)) {
|
|
|
@@ -109,8 +108,6 @@ class QianBaoWithdrawService
|
|
|
}
|
|
|
|
|
|
|
|
|
-
|
|
|
-
|
|
|
$pattern = "/^withdrawAddress@@bank_choose_channel_.*$/";
|
|
|
if (preg_match($pattern, $data)) {
|
|
|
$channel = preg_replace('/^withdrawAddress@@bank_choose_channel_/', '', $data);
|
|
|
@@ -124,6 +121,10 @@ class QianBaoWithdrawService
|
|
|
public static function onMessage($chatId, $text, $messageId, $stepStatus)
|
|
|
{
|
|
|
switch ($stepStatus) {
|
|
|
+ case StepStatus::QB_INPUT_ALIAS:
|
|
|
+ $res = QianBaoWithdrawService::inputAliAs($chatId, $text, $messageId);
|
|
|
+ return $res;
|
|
|
+ break;
|
|
|
case StepStatus::INPUT_WITHDRAW_QB_MONEY://输入提现金额
|
|
|
$res = QianBaoWithdrawService::inputQbAmount($chatId, $text, $messageId);
|
|
|
return $res;
|
|
|
@@ -570,17 +571,35 @@ class QianBaoWithdrawService
|
|
|
|
|
|
//输入姓名,并保存到数据库
|
|
|
private static function inputAccount($chatId, $account, $messageId)
|
|
|
+ {
|
|
|
+
|
|
|
+ Cache::put("{$chatId}_QB_ACCOUNT", $account);
|
|
|
+ Cache::put(get_step_key($chatId), StepStatus::QB_INPUT_ALIAS);
|
|
|
+
|
|
|
+ return [
|
|
|
+ 'chat_id' => $chatId,
|
|
|
+ 'text' => "请输入账号别名",
|
|
|
+ 'message_id' => $messageId,
|
|
|
+ ];
|
|
|
+
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ private static function inputAliAs($chatId, $alias, $messageId)
|
|
|
{
|
|
|
$channel = Cache::get("{$chatId}_QB_WITHDRAW_CHANNEL");
|
|
|
$cardNo = Cache::get("{$chatId}_QB_WITHDRAW_CARD_NO");
|
|
|
$bankName = Cache::get("{$chatId}_QB_WITHDRAW_BANK_NAME");
|
|
|
+ $account = Cache::get("{$chatId}_QB_ACCOUNT");
|
|
|
Bank::create([
|
|
|
'member_id' => $chatId,
|
|
|
'account' => $account,
|
|
|
'channel' => $channel,
|
|
|
'card_no' => $cardNo,
|
|
|
- 'bank_name' => $bankName
|
|
|
+ 'bank_name' => $bankName,
|
|
|
+ 'alias' => $alias
|
|
|
]);
|
|
|
- return static::banks($chatId, $messageId,$channel);
|
|
|
+ Cache::delete(get_step_key($chatId));
|
|
|
+ return static::banks($chatId, $messageId, $channel);
|
|
|
}
|
|
|
}
|