优化:豆豆积分抵扣支持不足抵扣金额时有多少积分抵扣多少金额

This commit is contained in:
wuhui_zzw 2024-01-31 13:44:44 +08:00
parent b5c164a2b7
commit e716d5dab2
1 changed files with 4 additions and 0 deletions

View File

@ -820,6 +820,10 @@ class StoreOrderCreateRepository extends StoreOrderRepository
} }
// 实际抵扣金额 * 购买数量 // 实际抵扣金额 * 购买数量
$productIntegralPrice = bcmul($productIntegralPrice, $cart['cart_num'], 2); $productIntegralPrice = bcmul($productIntegralPrice, $cart['cart_num'], 2);
// 判断:如果实际抵扣金额 超过持有积分,则实际抵扣金额=持有积分 2024-1-31
$productIntegralPrice = $productIntegralPrice > $hold_legumes_integral ? $hold_legumes_integral : $productIntegralPrice;
// 判断:当前商品是否可以参与积分抵扣 // 判断:当前商品是否可以参与积分抵扣
$isParticipation = $merchantCart['order']['true_price'] > 0 && $cart['product_type'] == 0 && $integralFlag && $productIntegralPrice > 0; $isParticipation = $merchantCart['order']['true_price'] > 0 && $cart['product_type'] == 0 && $integralFlag && $productIntegralPrice > 0;
if($isParticipation) $is_has_integral_use = 1;// 是否存在积分使用情况 只要存在一个则存在 if($isParticipation) $is_has_integral_use = 1;// 是否存在积分使用情况 只要存在一个则存在