|
@@ -175,11 +175,11 @@ class OrderService extends BaseService {
|
|
|
$info['num_install']=array_sum(array_column($info['goods'],'num_install'));
|
|
|
|
|
|
foreach ($info['goods'] as &$goods){
|
|
|
- list($amountReal,$amountKill,$amountOne)=$this->getAmount($goods['sku'],$goods['goods']);
|
|
|
+ list($amountReal,$amountKill,$amountOrigin)=$this->getAmount($goods['sku'],$goods['goods']);
|
|
|
$goods['amount_pay']=bcmul($amountReal,$goods['num']);
|
|
|
- $goods['amount_total']=bcmul($amountOne,$goods['num']);
|
|
|
+ $goods['amount_total']=bcmul($amountOrigin,$goods['num']);
|
|
|
$goods['amount_coupon_kill']=bcmul($amountKill,$goods['num']);
|
|
|
- $goods['amount_install']=InstallService::getFee([$goods],'num_install');
|
|
|
+ $goods['amount_install']=InstallService::getFee([$goods['sku']['id']=>$goods]);
|
|
|
|
|
|
$info['amount_pay']=bcadd($info['amount_pay'],$goods['amount_pay']);
|
|
|
$info['amount_total']=bcadd($info['amount_total'],$goods['amount_total']);
|
|
@@ -187,17 +187,13 @@ class OrderService extends BaseService {
|
|
|
$info['amount_install']=bcadd($info['amount_install'],$goods['amount_install']);
|
|
|
}
|
|
|
|
|
|
- #安装费
|
|
|
- //$info['amount_install']=InstallService::getFee(array_column($info['goods'],null,'goods_sku_id'),'num_install');
|
|
|
- //$info['amount_total']=bcadd($info['amount_total'],$info['amount_install']);
|
|
|
-
|
|
|
#优惠券
|
|
|
$couponAmount=0;
|
|
|
if(!empty($this->coupon_use)){
|
|
|
$use=false;
|
|
|
$coupon=$user->coupon()->lock($this->isSubmit())->findOrFail($this->coupon_id);
|
|
|
foreach ($info['goods'] as &$goods){
|
|
|
- $amount=$goods['this_amount'];
|
|
|
+ $amount=$goods['amount_pay'];
|
|
|
if($coupon->canUse($amount,$goods['goods_id'])){
|
|
|
$use=true;
|
|
|
$couponAmount=$coupon['amount'];
|
|
@@ -217,6 +213,8 @@ class OrderService extends BaseService {
|
|
|
}
|
|
|
|
|
|
$info['amount_pay']=bcsub($info['amount_pay'],$couponAmount);
|
|
|
+ $info['amount_pay']=bcadd($info['amount_pay'],$info['amount_install']);
|
|
|
+ $info['amount_total']=bcadd($info['amount_total'],$info['amount_install']);
|
|
|
|
|
|
#删除购物车
|
|
|
if($this->isClearCart()){
|