Ken 1 settimana fa
parent
commit
5c89bb1007
1 ha cambiato i file con 18 aggiunte e 15 eliminazioni
  1. 18 15
      app/Services/WithdrawService.php

+ 18 - 15
app/Services/WithdrawService.php

@@ -463,22 +463,25 @@ class WithdrawService
                 'reply_to_message_id' => $messageId
             ]];
         }
+        $rate = Config::where('field', 'exchange_rate_rmb')->first()->val ?? 1;
+
+        $amountRmb = bcmul($rate, $amount, 2);
 
-//        if($amount < 100){
-//            return [[
-//                'chat_id' => $chatId,
-//                'text' => lang("提现不能少于100 RMB,请重试"),
-//                'reply_to_message_id' => $messageId
-//            ]];
-//        }
-//
-//        if ($amount > 49999) {
-//            return [
-//                'chat_id' => $chatId,
-//                'text' => lang("最多提现 49999 RMB,请重试"),
-//                'reply_to_message_id' => $messageId
-//            ];
-//        }
+        if($amountRmb < 100){
+            return [[
+                'chat_id' => $chatId,
+                'text' => lang("提现不能少于100 RMB,请重试"),
+                'reply_to_message_id' => $messageId
+            ]];
+        }
+
+        if ($amountRmb > 49999) {
+            return [
+                'chat_id' => $chatId,
+                'text' => lang("最多提现 49999 RMB,请重试"),
+                'reply_to_message_id' => $messageId
+            ];
+        }
 
 
         $wallet = Wallet::where('member_id', $chatId)->first();