1. 打开`app/common/repositories/store/order/StoreOrderCreateRepository.php`文件,找到`653`行
2. 按照下图修改第653行和662行代码的红色下划线部分
if (isset($platformCouponRate)) {
$_coupon_price = $platformCouponRate['coupon_price'];
foreach ($merchantCartList as &$merchantCart) {
$_price = 0;
foreach ($merchantCart['list'] as &$cart) {
if ($cart['true_price'] <= 0 || !$platformCouponRate['check']($cart)) continue;
if ($platformCouponRate['use_count'] === 1) {
$couponPrice = min($platformCouponRate['coupon_price'], $cart['true_price']);
} else {
$couponPrice = min(bcmul($_coupon_price, bcdiv($cart['true_price'], $platformCouponRate['price'], 3), 2), $cart['true_price']);
}
$platformCouponRate['coupon_price'] = bcsub($platformCouponRate['coupon_price'], $couponPrice, 2);
$cart['true_price'] = bcsub($cart['true_price'], $couponPrice, 2);
$cart['platform_coupon_price'] = $couponPrice;
$platformCouponRate['use_count']--;
$_price = bcadd($couponPrice, $_price, 2);
}
unset($cart);
$merchantCart['order']['platform_coupon_price'] = $_price;
$merchantCart['order']['true_price'] = bcsub($merchantCart['order']['true_price'], $_price, 2);
$total_platform_coupon_price = bcadd($total_platform_coupon_price, $_price, 2);
}
3. 修改后重启 swoole 服务
{{item.user_info.nickname ? item.user_info.nickname : item.user_name}}
作者 管理员 企业
{{itemf.name}}
{{itemc.user_info.nickname}}
{{itemc.user_name}}
回复 {{itemc.comment_user_info.nickname}}
{{itemf.name}}