修复:随机立减 - 当最大金额和最小金额存在0时,计算错误导致下单失败
This commit is contained in:
parent
92330982bd
commit
daf6af005b
|
|
@ -837,7 +837,7 @@ class StoreOrderCreateRepository extends StoreOrderRepository{
|
|||
$maxNum = $systemConfig['random_reduction_max'] ?? 5;
|
||||
// 判断:如果最大立减金额 大于剩余支付金额;则最大立减金额=剩余支付金额,否则不变
|
||||
$maxNum = $maxNum > $cart['true_price'] ? $cart['true_price'] : $maxNum;
|
||||
$randomReduction = getRandom($minNum, $maxNum);
|
||||
$randomReduction = getRandom((float)$minNum, (float)$maxNum);
|
||||
|
||||
$cart['random_reduction'] = $randomReduction;
|
||||
$cart['true_price'] = bcsub($cart['true_price'],$randomReduction,2);;
|
||||
|
|
|
|||
Loading…
Reference in New Issue