fix : auto coupon
This commit is contained in:
@@ -72,7 +72,20 @@ class ConfirmationOrderService extends BaseOrderService
|
|||||||
foreach ($filtered as &$value) {
|
foreach ($filtered as &$value) {
|
||||||
$value['amount'] = match ($value['coupon_type']) {
|
$value['amount'] = match ($value['coupon_type']) {
|
||||||
CouponCode::COUPON_TYPE_INSTANT_REDUCTION => $value['amount'],
|
CouponCode::COUPON_TYPE_INSTANT_REDUCTION => $value['amount'],
|
||||||
CouponCode::COUPON_TYPE_DISCOUNT => bcmul(bcsub("1", (string)$value['ratio'],2),(string)$orderMaxPrice,2),
|
// CouponCode::COUPON_TYPE_DISCOUNT => bcmul(bcsub("100", (string)$value['ratio'],2),(string)$orderMaxPrice,2),
|
||||||
|
CouponCode::COUPON_TYPE_DISCOUNT => bcmul(
|
||||||
|
bcdiv(
|
||||||
|
bcsub(
|
||||||
|
"100",
|
||||||
|
(string)$value['ratio'],
|
||||||
|
2
|
||||||
|
),
|
||||||
|
"100",
|
||||||
|
2
|
||||||
|
),
|
||||||
|
bcadd((string)max(array_column($this->orderRes['good'],'price')),(string)$this->orderRes['sundry_price'],2),
|
||||||
|
2
|
||||||
|
),
|
||||||
default => 0
|
default => 0
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user