Ken 4 ヶ月 前
コミット
3d61dd9fe9

+ 6 - 2
app/Constants/StepStatus.php

@@ -8,8 +8,7 @@ class StepStatus
     const INPUT_ROOM_NUM = 2;//输入 人数/局数
     const INPUT_GAME_ID = 3;//输入 游戏ID
     const INPUT_GAME_NAME = 4;//输入  游戏名称
-    const INPUT_GAME_INTRODUCTION = 14;//输入  游戏介绍
-    const INPUT_MIDWAY = 15;//选择是否允许中途加入
+
 
     const INPUT_SCORE = 5;//输入 结算分数
     const INPUT_IMAGE = 6;//上传 战绩截图
@@ -24,6 +23,11 @@ class StepStatus
 
     const INPUT_TOP_UP_MONEY = 12;//输入 充值金额
     const INPUT_TOP_UP_IMAGE = 13;//上传 充值截图
+    const INPUT_GAME_INTRODUCTION = 14;//输入  游戏介绍
+    const INPUT_MIDWAY = 15;//选择是否允许中途加入
+
+
+    const INPUT_WITHDRAW_QB_MONEY = 16;//输入 钱宝提现金额
 
 
 }

+ 4 - 0
app/Http/Controllers/api/TelegramWebHook.php

@@ -626,6 +626,10 @@ class TelegramWebHook extends Controller
                                 $res = (new WithdrawService())->inputAmount($chatId, $text, $messageId);
                                 return $res[0];
                                 break;
+                            case StepStatus::INPUT_WITHDRAW_QB_MONEY:
+                                $res =  WithdrawService::inputQbAmount($chatId, $text, $messageId);
+                                return $res;
+                                break;
                             case StepStatus::INPUT_ADDRESS_TRC20:
                                 $res = WithdrawService::inputAddress($chatId, $text, $messageId);
                                 return $res;

+ 18 - 0
app/Services/WithdrawService.php

@@ -474,6 +474,21 @@ class WithdrawService
         ]];
     }
 
+
+    //输入钱宝提现金额
+    static function inputQbAmount($chatId, $amount, $messageId)
+    {
+        if (!preg_match('/^-?\d+(\.\d+)?$/', $amount)) {
+            return [
+                'chat_id' => $chatId,
+                'text' => "金额输入不正确,请发送提现数字",
+                'reply_to_message_id' => $messageId
+            ];
+        }
+        $wallet = Wallet::where('member_id', $chatId)->first();
+        $temp = floatval($wallet->available_balance);
+    }
+
     //钱宝提现
     static function qbApply($chatId, $messageId)
     {
@@ -500,6 +515,9 @@ class WithdrawService
         $temp = floatval($wallet->available_balance);
         $text = "请发送提现金额\n";
         $text .= "💰 当前余额{$temp} RMB\n";
+
+
+        Cache::put(get_step_key($chatId), StepStatus::INPUT_WITHDRAW_QB_MONEY);
         return [
             'chat_id' => $chatId,
             'text' => $text,