Commit f797b260 authored by wwccw0591's avatar wwccw0591

refund

parent 055d0f51
......@@ -1010,11 +1010,12 @@ class RefundServiceModel extends \Business\AbstractModel
$shippingFee = ApiConst::zero;
$allReadyGoodsCount=count($goodsIds);
$allGoodsCount=count($orderGoodses);
if($allReadyGoodsCount==$allGoodsCount){
$shippingFee = $storeDao->isFee($orderInfo['storeId'], $orderInfo['shippingType'], $orderInfo['orderState']) ? $orderInfo['shippingFee'] : ApiConst::zero;
}else{
$shippingFee == ApiConst::zero;
}
// if($allReadyGoodsCount==$allGoodsCount){
// $shippingFee = $storeDao->isFee($orderInfo['storeId'], $orderInfo['shippingType'], $orderInfo['orderState']) ? $orderInfo['shippingFee'] : ApiConst::zero;
// }else{
// $shippingFee == ApiConst::zero;
// }
// if (count($orderGoods) == ApiConst::one) {
// $shippingFee = $storeDao->isFee($orderInfo['storeId'], $orderInfo['shippingType'], $orderInfo['orderState']) ? $orderInfo['shippingFee'] : ApiConst::zero;
// } else {
......@@ -1042,12 +1043,7 @@ class RefundServiceModel extends \Business\AbstractModel
// if($orderInfo['shippingType']==ApiConst::bySelf){
$returnData['needShippingFee']=ApiConst::zero;
// }
//修改后的优惠金额
$discountAmount=$orderInfo['originAmount']- $orderInfo['orderAmount'];
$mustReduceAmount=ApiConst::zero;
if($discountAmount){
$mustReduceAmount=$orderGoodsDao->getMustReduceAmount($allOrderGoods,$discountAmount,$orderGoodsConvert);
}
if ($orderInfo['paymentTime']) {
$orderConfirmUtil = \Order\OrderConfirmUtil::getInstance();
......@@ -1072,18 +1068,29 @@ class RefundServiceModel extends \Business\AbstractModel
// $refundAmount=$refundAmount-$discountAmount;
// }
}
$refundAmount=$refundAmount+$orderInfo['shippingFee'];
//修改后的优惠金额按比例退回
$discountAmount=$orderInfo['originAmount']- $orderInfo['orderAmount'];
$mustReduceAmount=ApiConst::zero;
if($discountAmount){
$mustReduceAmount=$orderGoodsDao->getMustReduceAmount($allOrderGoods,$discountAmount,$orderGoodsConvert);
}
$refundAmount=$refundAmount-$mustReduceAmount;
//配送订单配送费按比例收取
if($orderInfo['shippingType']==ApiConst::bySeller){
if(!$shippingFee){
$refundAmount=$refundAmount+$orderInfo['shippingFee'];
$mustSheepingFee=ApiConst::zero;
if($discountAmount){
$mustSheepingFee=$orderGoodsDao->getMustReduceAmount($allOrderGoods,$orderInfo['shippingFee'],$orderGoodsConvert);
}
$refundAmount=$refundAmount-$mustSheepingFee;
}
$liveMoney=$orderInfo['orderAmount']-$orderInfo['refundAmount'];
if($refundAmount>$liveMoney){
$refundAmount=$liveMoney;
}
// $returnData['refundAmount'] = $refundAmount - $orderInfo['refundAmount'] - $returnData['needShippingFee'] + $shippingFee;
$returnData['refundAmount'] = $refundAmount - $returnData['needShippingFee'];
// $returnData['refundAmount'] = $refundAmount - $returnData['needShippingFee'];
$returnData['refundAmount'] = $refundAmount;
if((int)$returnData['refundAmount'] <ApiConst::zero){
$returnData['refundAmount']=ApiConst::zero;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment