fix : coupon

This commit is contained in:
2025-03-31 17:52:14 +08:00
parent 8d2b522345
commit e6176f6bbd
2 changed files with 8 additions and 6 deletions

View File

@@ -408,18 +408,19 @@ trait OrderTrait
"100",
2
),
max(array_column($this->orderRes['good'],'price')),
bcadd((string)max(array_column($this->orderRes['good'],'price')),(string)$this->orderRes['sundry_price'],2),
2
),
default => 0
};
}
$this->orderRes['favorable_good_price'] = $this->orderRes['coupon']['coupon_type'] == CouponCode::COUPON_TYPE_INSTANT_REDUCTION ?
min($this->orderRes['coupon']['amount'], $this->orderRes['good_after_discount_price']) :
$this->orderRes['coupon']['amount'];
$this->orderRes['good_after_discount_price'] = bcsub((string)$this->orderRes['good_after_discount_price'],(string)$this->orderRes['favorable_good_price'],2);
$this->orderRes['actual_price'] = bcsub((string)$this->orderRes['actual_price'],(string)$this->orderRes['favorable_good_price'],2);
// $this->orderRes['favorable_good_price'] = $this->orderRes['coupon']['coupon_type'] == CouponCode::COUPON_TYPE_INSTANT_REDUCTION ?
// min($this->orderRes['coupon']['amount'], $this->orderRes['good_after_discount_price']) :
// $this->orderRes['coupon']['amount'];
// $this->orderRes['good_after_discount_price'] = bcsub((string)$this->orderRes['good_after_discount_price'],(string)$this->orderRes['favorable_good_price'],2);
$this->orderRes['discount_price'] = min($this->orderRes['coupon']['amount'],$this->orderRes['coupon']['actual_price']);
$this->orderRes['actual_price'] = bcsub((string)$this->orderRes['actual_price'],(string)$this->orderRes['discount_price'],2);
}
/**