|
|
@@ -93,9 +93,11 @@ class HdRefundService extends BaseService
|
|
|
}
|
|
|
foreach ($itemInfoList as $currentProduct) {
|
|
|
$id = $currentProduct['productId'] ?? 0;
|
|
|
+ $unitPrice = $currentProduct['unitPrice'] ?? 0;
|
|
|
$unitType = $currentProduct['unitType'] ?? 0;
|
|
|
$unitName = $currentProduct['unitName'] ?? '';
|
|
|
$currentRefundNum = $currentProduct['num'] ?? 0;
|
|
|
+ $price = bcmul($currentRefundNum, $unitPrice, 2);
|
|
|
$name = $productInfo[$id]['name'] ?? '';
|
|
|
$ptItemId = $productInfo[$id]['itemId'] ?? 0;
|
|
|
$cover = $productInfo[$id]['cover'] ?? '';
|
|
|
@@ -130,6 +132,8 @@ class HdRefundService extends BaseService
|
|
|
'ratio' => $ratio,
|
|
|
'bigUnit' => $bigUnit,
|
|
|
'smallUnit' => $smallUnit,
|
|
|
+ 'unitPrice' => $unitPrice,
|
|
|
+ 'price' => $price,
|
|
|
];
|
|
|
HdRefundItemClass::addData($thisItemData, $refundSn, $post);
|
|
|
}
|
|
|
@@ -140,8 +144,10 @@ class HdRefundService extends BaseService
|
|
|
$orderGoodsData = OrderGoodsClass::getAllByCondition(['orderSn' => $xsOrderSn], null, '*', 'goodsId', true);
|
|
|
foreach ($goodsInfoList as $currentGoods) {
|
|
|
$goodsId = $currentGoods['productId'] ?? 0;
|
|
|
+ $unitPrice = $currentGoods['unitPrice'] ?? 0;
|
|
|
$name = $goodsData[$goodsId]['name'] ?? '';
|
|
|
$currentRefundNum = $currentGoods['num'] ?? 0;
|
|
|
+ $price = bcmul($currentRefundNum, $unitPrice, 2);
|
|
|
$currentOrderGoods = $orderGoodsData[$goodsId] ?? [];
|
|
|
if (empty($currentOrderGoods)) {
|
|
|
util::fail('没有找到商品呢');
|
|
|
@@ -160,10 +166,14 @@ class HdRefundService extends BaseService
|
|
|
$saveGoods = [
|
|
|
'refundSn' => $refundSn,
|
|
|
'mainId' => $mainId,
|
|
|
+ 'sjId' => $sjId,
|
|
|
+ 'shopId' => $shopId,
|
|
|
'name' => $name,
|
|
|
'cover' => $cover,
|
|
|
'goodsId' => $goodsId,
|
|
|
'num' => $num,
|
|
|
+ 'unitPrice' => $unitPrice,
|
|
|
+ 'price' => $price,
|
|
|
];
|
|
|
HdRefundGoodsClass::addData($saveGoods, $refundSn, $post);
|
|
|
}
|