|
@@ -149,6 +149,7 @@ class OrderService extends BaseService {
|
|
|
'amount_total'=>0,
|
|
|
'amount_pay'=>0,
|
|
|
'amount_coupon'=>0,
|
|
|
+ 'amount_coupon_kill'=>0,
|
|
|
'amount_install'=>0,
|
|
|
'num'=>0,
|
|
|
'num_install'=>0,
|
|
@@ -174,9 +175,11 @@ class OrderService extends BaseService {
|
|
|
$info['num_install']=array_sum(array_column($info['goods'],'num_install'));
|
|
|
|
|
|
foreach ($info['goods'] as &$goods){
|
|
|
- $amount=bcmul($this->getAmount($goods['sku'],$goods['goods']),$goods['num']);
|
|
|
+ list($amountSingle,$goods['amount_coupon_kill'])=$this->getAmount($goods['sku'],$goods['goods']);
|
|
|
+ $amount=bcmul($amountSingle,$goods['num']);
|
|
|
$goods['this_amount']=$amount;
|
|
|
- $info['amount_total']=bcadd($info['amount_total'],$amount);
|
|
|
+ $info['amount_total']=bcadd($info['amount_total'],$goods['this_amount']);
|
|
|
+ $info['amount_coupon_kill']=bcadd($info['amount_coupon_kill'],$goods['amount_coupon_kill']);
|
|
|
}
|
|
|
|
|
|
#安装费
|
|
@@ -223,11 +226,13 @@ class OrderService extends BaseService {
|
|
|
}
|
|
|
|
|
|
protected function getAmount($sku,$goods){
|
|
|
+ $amountArr=[0,0];
|
|
|
if(KillService::open() && $goods['is_kill']){
|
|
|
- $amount=$sku['amount_kill'];
|
|
|
+ $amountArr[0]=$sku['amount_kill'];
|
|
|
+ $amountArr[1]=bcsub($sku['amount'],$sku['amount_kill']);
|
|
|
}else{
|
|
|
- $amount=$sku['amount'];
|
|
|
+ $amountArr[0]=$sku['amount'];
|
|
|
}
|
|
|
- return $amount;
|
|
|
+ return $amountArr;
|
|
|
}
|
|
|
}
|