|
|
@@ -182,10 +182,11 @@ class OrderService extends BaseService
|
|
|
$sourceType = isset($params['sourceType']) ? $params['sourceType'] : 0;
|
|
|
$discountAmount = 0;
|
|
|
$discountType = 0;
|
|
|
+ $discountPrice = $price;
|
|
|
//使用优惠券
|
|
|
if (!empty($couponId)) {
|
|
|
$discountAmount = CouponService::valid($couponId, $price, $userId);
|
|
|
- $price = stringUtil::calcSub($price, $discountAmount);
|
|
|
+ $discountPrice = stringUtil::calcSub($price, $discountAmount);
|
|
|
$discountType = 1;
|
|
|
}
|
|
|
//使用会员
|
|
|
@@ -196,6 +197,7 @@ class OrderService extends BaseService
|
|
|
$newPrice = substr(sprintf("%.3f", $currentPrice), 0, -2);
|
|
|
$discountType = 2;
|
|
|
$discountAmount = stringUtil::calcSub($price, $newPrice);
|
|
|
+ $discountPrice = $newPrice;
|
|
|
}
|
|
|
|
|
|
//使用随机优惠 shish 2019.9.12
|
|
|
@@ -206,11 +208,11 @@ class OrderService extends BaseService
|
|
|
if ($env == 'local' || $env == 'test') {
|
|
|
$discountAmount = 0.01;
|
|
|
}
|
|
|
- $price = stringUtil::calcSub($price, $discountAmount);
|
|
|
+ $discountPrice = stringUtil::calcSub($price, $discountAmount);
|
|
|
$discountType = 3;
|
|
|
}
|
|
|
$discountType = $discountAmount <= 0 ? 0 : $discountType;
|
|
|
- return ['price' => $price, 'discountType' => $discountType, 'discountAmount' => $discountAmount];
|
|
|
+ return ['price' => $discountPrice, 'discountType' => $discountType, 'discountAmount' => $discountAmount];
|
|
|
}
|
|
|
|
|
|
}
|