Commit 565ed0f7 authored by christ's avatar christ

bug2644

parent acc52751
...@@ -992,6 +992,7 @@ class RefundServiceModel extends \Business\AbstractModel ...@@ -992,6 +992,7 @@ class RefundServiceModel extends \Business\AbstractModel
$orderGoodses = \Our\RedisHelper::cachedFunction(\Redis\Db5\RefundReasonRedisModel::getInstance(), array(&$orderGoodsDao, 'getOrderGoodsByOrderIds'), array($orderInfo['orderId'], $this->orderGoodsField), \Our\ApiConst::oneDaySecond); $orderGoodses = \Our\RedisHelper::cachedFunction(\Redis\Db5\RefundReasonRedisModel::getInstance(), array(&$orderGoodsDao, 'getOrderGoodsByOrderIds'), array($orderInfo['orderId'], $this->orderGoodsField), \Our\ApiConst::oneDaySecond);
$orderGoodses = $orderGoodsDao->convertOrderGoods($orderGoodses, 'goodsId'); $orderGoodses = $orderGoodsDao->convertOrderGoods($orderGoodses, 'goodsId');
$goodsIds = $orderGoodsDao->getRefundOrderGoodsIds($orderGoodses); $goodsIds = $orderGoodsDao->getRefundOrderGoodsIds($orderGoodses);
$alreadyRefundGoodsIds=$goodsIds;
// $this->store=$storeDao->get($this->order['storeId']); // $this->store=$storeDao->get($this->order['storeId']);
// $this->store=Common::convertUnderline($this->store[0]); // $this->store=Common::convertUnderline($this->store[0]);
$this->store = \Our\RedisHelper::cachedFunction(\Redis\Db5\OrderRedisModel::getInstance(), array(&$storeDao, 'getInfoById'), array($orderInfo['storeId'], $storeDao->detailField), \Our\ApiConst::sevenDaySecond,array($orderInfo['storeId'])); $this->store = \Our\RedisHelper::cachedFunction(\Redis\Db5\OrderRedisModel::getInstance(), array(&$storeDao, 'getInfoById'), array($orderInfo['storeId'], $storeDao->detailField), \Our\ApiConst::sevenDaySecond,array($orderInfo['storeId']));
...@@ -1046,10 +1047,15 @@ class RefundServiceModel extends \Business\AbstractModel ...@@ -1046,10 +1047,15 @@ class RefundServiceModel extends \Business\AbstractModel
$refundAmount = $orderInfo['orderAmount'] - $orderInfo['shippingFee'] - ApiConst::zero;; $refundAmount = $orderInfo['orderAmount'] - $orderInfo['shippingFee'] - ApiConst::zero;;
} }
} }
if(!$alreadyRefundGoodsIds){
$refundAmount=$refundAmount-$discountAmount; $refundAmount=$refundAmount-$discountAmount;
}
} else { } else {
$refundAmount = $orderGoods['goodsPrice']*$orderGoods['goodsNum']; $refundAmount = $orderGoods['goodsPrice']*$orderGoods['goodsNum'];
$refundAmount =$refundAmount-$discountAmount; if(!$alreadyRefundGoodsIds){
$refundAmount=$refundAmount-$discountAmount;
}
} }
$returnData['refundAmount'] = $refundAmount - $orderInfo['refundAmount'] - $returnData['needShippingFee'] + $shippingFee; $returnData['refundAmount'] = $refundAmount - $orderInfo['refundAmount'] - $returnData['needShippingFee'] + $shippingFee;
if((int)$returnData['refundAmount'] <ApiConst::zero){ if((int)$returnData['refundAmount'] <ApiConst::zero){
......
...@@ -165,7 +165,8 @@ class OrderGoodsModel extends \DAO\AbstractModel { ...@@ -165,7 +165,8 @@ class OrderGoodsModel extends \DAO\AbstractModel {
// unset($orderGoods[$i]); // unset($orderGoods[$i]);
} }
} }
return array_column($newOrderGoods,'goodsId'); $goodsIds=array_column($newOrderGoods,'goodsId');
return $goodsIds;
} }
/** /**
* 根据订单id 获得订单商品记录 * 根据订单id 获得订单商品记录
......
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