Ken 2 주 전
부모
커밋
02f148745e
3개의 변경된 파일41개의 추가작업 그리고 4개의 파일을 삭제
  1. 1 2
      app/Services/ConfigService.php
  2. 3 2
      app/Services/WithdrawService.php
  3. 37 0
      database/migrations/2026_01_14_161318_insert_config.php

+ 1 - 2
app/Services/ConfigService.php

@@ -157,8 +157,7 @@ class ConfigService extends BaseService
         $result = json_decode($result, true);
         $rate = number_format($result['usd']['cnh'], 2);
         $info = self::findOne(['field' => 'exchange_rate_rmb']);
-        //在原有基础上 增加0.15 的汇率
-        $info->val = bcadd($rate, 0.15, 2);
+        $info->val = $rate;
         $info->save();
         return $result;
     }

+ 3 - 2
app/Services/WithdrawService.php

@@ -482,12 +482,13 @@ class WithdrawService
         $wallet = Wallet::where('member_id', $chatId)->first();
         // 汇率
         $rate = Config::where('field', 'exchange_rate_rmb')->first()->val ?? 1;
+
         $temp = floatval($wallet->available_balance);
         $amount = bcdiv($temp, $rate, 2);
         $text = lang("请发送提现金额");
-        $text .= "\n💰 ".lang('当前余额')."{$temp} RMB\n";
+        $text .= "\n💰 ".lang('当前余额')."{$temp} RMB\n";
         $text .= "⚠️".lang('汇率').":1 USDT = {$rate} RMB\n";
-        $text .= "💰 ".lang('当前可用USDT余额').":{$amount}\n";
+        $text .= "💰 ".lang('当前可用USDT余额').":{$amount} USDT\n";
         $text .= "⚠️ ".lang('提现将收取')."{$this->serviceCharge}".lang('U作为手续费')."\n";
 //        $keyboard = [[
 //            ['text' => "🔙返回", 'callback_data' => "withdraw@@home"],

+ 37 - 0
database/migrations/2026_01_14_161318_insert_config.php

@@ -0,0 +1,37 @@
+<?php
+
+use Illuminate\Database\Migrations\Migration;
+use Illuminate\Database\Schema\Blueprint;
+use Illuminate\Support\Facades\Schema;
+use Illuminate\Support\Facades\DB;
+return new class extends Migration
+{
+    /**
+     * Run the migrations.
+     *
+     * @return void
+     */
+    public function up()
+    {
+        DB::table('config')->insert([
+            [
+                'field' => 'exchange_rate_difference',
+                'val' => "0.15",
+                'remark' => '汇率差值',
+                'group_id' => 1,
+                'created_at' => now(),
+                'updated_at' => now(),
+            ]
+        ]);
+    }
+
+    /**
+     * Reverse the migrations.
+     *
+     * @return void
+     */
+    public function down()
+    {
+        //
+    }
+};