Procházet zdrojové kódy

Merge branch 'master' of e.coding.net:g-ueau9359/kku/kku_laravel

* 'master' of e.coding.net:g-ueau9359/kku/kku_laravel:
  fix(fund): 修复 MEX 推送订单资金转移的精度问题
AI Assistant před 6 měsíci
rodič
revize
04d7d0e59a
1 změnil soubory, kde provedl 4 přidání a 8 odebrání
  1. 4 8
      app/Module/Mex/Logic/MexMatchLogic.php

+ 4 - 8
app/Module/Mex/Logic/MexMatchLogic.php

@@ -851,12 +851,10 @@ class MexMatchLogic
 
             // 从用户冻结账户转移到仓库账户
             $fundService = new FundService($userId, $frozenAccountType->value);
-            $precision = $currencyType->getPrecision();
-            $fundAmount = (int)bcmul($amount, bcpow('10', $precision), 0); // 根据币种精度转换
-
+            // 多少钱,就是多少钱,资金模块能够正确处理,不需要外部处理
             $result = $fundService->trade(
                 self::WAREHOUSE_USER_ID,
-                $fundAmount,
+                $amount,
                 'MEX_ORDER',
                 $orderId,
                 '用户买入物品撮合-资金转移'
@@ -991,12 +989,10 @@ class MexMatchLogic
 
             // 从仓库账户转移到用户账户
             $fundService = new FundService(self::WAREHOUSE_USER_ID, $availableAccountType->value);
-            $precision = $currencyType->getPrecision();
-            $fundAmount = (int)bcmul($amount, bcpow('10', $precision), 0); // 根据币种精度转换
-
+            // 资金系统,能够正确处理金额,不需要外部处理
             $result = $fundService->trade(
                 $userId,
-                $fundAmount,
+                $amount,
                 'MEX_ORDER',
                 $orderId,
                 '用户卖出物品撮合-资金转移'