Эх сурвалжийг харах

fix(lakala): 修复分账订单计算逻辑

- 调整分账最低比例计算方式,使用bcsub函数确保精度
- 确保分账费用计算的准确性
- 优化金额比较逻辑,避免精度丢失问题
runphp 4 сар өмнө
parent
commit
c3c0948c29

+ 1 - 0
src/Entity/ProfitShareOrderEntity.php

@@ -68,6 +68,7 @@ class ProfitShareOrderEntity extends BaseEntity
      */
     private function calculateOrder(float $amount, float $splitLowestRatio): array
     {
+        $splitLowestRatio = bcsub(100, (string)$splitLowestRatio, 2);
         $fee = Config::getConfig('profit_share_fee');
         $feeAmt = bcmul((string)$amount, (string)$fee, 2);
         if (bccomp($feeAmt, '1') == -1) {