Ken 1 hete
szülő
commit
7d25a51b91
1 módosított fájl, 9 hozzáadás és 8 törlés
  1. 9 8
      app/Services/WithdrawService.php

+ 9 - 8
app/Services/WithdrawService.php

@@ -440,8 +440,8 @@ class WithdrawService
             ->whereIn('status', [0, 1, 2, 3])
             ->first();
         if ($ru) {
-            $text = lang('*游戏未结算*')."\n";
-            $text .= lang("⚠️ 您还有进行中的游戏,所有游戏结算后方可提现")."\n";
+            $text = lang('*游戏未结算*') . "\n";
+            $text .= lang("⚠️ 您还有进行中的游戏,所有游戏结算后方可提现") . "\n";
             return [[
                 'chat_id' => $chatId,
                 'text' => $text,
@@ -463,7 +463,7 @@ class WithdrawService
             ['text' => lang('❌取消'), 'callback_data' => "message@@close"]
         ];
 
-        $text = lang('请直接选择下面的地址')."\n";
+        $text = lang('请直接选择下面的地址') . "\n";
         $text .= lang("⚠️提示:请务必确认提现地址正确无误,\n否则资金丢失将无法找回请自负!");
         Cache::put("{$chatId}_WITHDRAW_MONEY", $amount);
         Cache::put(get_step_key($chatId), StepStatus::CHOOSE_WITHDRAW_ADDRESS);
@@ -482,14 +482,15 @@ class WithdrawService
         $wallet = Wallet::where('member_id', $chatId)->first();
         // 汇率
         $rate = Config::where('field', 'exchange_rate_rmb')->first()->val ?? 1;
-
+        $exchange_rate_difference = Config::where('field', 'exchange_rate_difference')->first()->val ?? 0;
+        $rate = bcadd($rate, $exchange_rate_difference, 2);
         $temp = floatval($wallet->available_balance);
         $amount = bcdiv($temp, $rate, 2);
         $text = lang("请发送提现金额");
-        $text .= "\n💰 ".lang('当前余额').":{$temp} RMB\n";
-        $text .= "⚠️".lang('汇率').":1 USDT = {$rate} RMB\n";
-        $text .= "💰 ".lang('当前可用USDT余额').":{$amount} USDT\n";
-        $text .= "⚠️ ".lang('提现将收取')."{$this->serviceCharge}".lang('U作为手续费')."\n";
+        $text .= "\n💰 " . lang('当前余额') . ":{$temp} RMB\n";
+        $text .= "⚠️" . lang('汇率') . ":1 USDT = {$rate} RMB\n";
+        $text .= "💰 " . lang('当前可用USDT余额') . ":{$amount} USDT\n";
+        $text .= "⚠️ " . lang('提现将收取') . "{$this->serviceCharge}" . lang('U作为手续费') . "\n";
 //        $keyboard = [[
 //            ['text' => "🔙返回", 'callback_data' => "withdraw@@home"],
 //        ]];