Commit b7d7ae96 authored by christ's avatar christ

refudn

parent fdd7deb3
......@@ -1022,7 +1022,6 @@ class RefundServiceModel extends \Business\AbstractModel
// $shippingFee == ApiConst::zero;
// }
$orderGoodsConvert = $orderGoodsDao->getRefundOrderGoods($orderGoods);
$returnData = array(
'orderId' => (int)$orderId,
'orderSn'=>$orderInfo['orderSn'],
......
......@@ -230,14 +230,18 @@ class OrderGoodsModel extends \DAO\AbstractModel
);
}
public function getMustReduceAmount($orderGoodses, $discountAmount, $orderGoods)
public function getMustReduceAmount($orderGoodses, $discountAmount, $convertOrderGoods)
{
$allNumbers = array_column($orderGoodses, 'goodsNum');
$allNumbers=array_sum($allNumbers);
$allGoodsPrice = array_column($orderGoodses, 'goodsPrice');
$allGoodsPrice=array_sum($allGoodsPrice);
$allMoney = $allNumbers * $allGoodsPrice;
$thisOrderGoodsAmount = $orderGoods['goodsNum'] * $orderGoods['goodsPrice'];
$allMoney=0;
foreach($orderGoodses as &$orderGoods){
$allMoney+= $orderGoods['goodsNum']*$orderGoods['goodsPrice'];
}
// $allNumbers = array_column($orderGoodses, 'goodsNum');
// $allNumbers=array_sum($allNumbers);
// $allGoodsPrice = array_column($orderGoodses, 'goodsPrice');
// $allGoodsPrice=array_sum($allGoodsPrice);
// $allMoney = $allNumbers * $allGoodsPrice;
$thisOrderGoodsAmount = $convertOrderGoods['goodsNum'] * $convertOrderGoods['goodsPrice'];
$reduceAmount=($discountAmount*$thisOrderGoodsAmount)/($allMoney);
return round($reduceAmount);
......
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