|
|
@@ -33,19 +33,21 @@ class HdRefundItemClass extends BaseClass
|
|
|
$sjId = $data['sjId'] ?? 0;
|
|
|
$shopAdminName = $post['shopAdminName'] ?? '';
|
|
|
|
|
|
- $stockInfo = ProductClass::addStock($itemId, $bigNum, $smallNum);
|
|
|
- $recordData = [];
|
|
|
- $recordData['sjId'] = $sjId;
|
|
|
- $recordData['shopId'] = $shopId;
|
|
|
- $recordData['mainId'] = $mainId;
|
|
|
- $recordData['itemId'] = $ptItemId;
|
|
|
- $recordData['itemNum'] = ProductClass::mergeItemNum($bigNum, $smallNum, $ratio);
|
|
|
- $recordData['oldStock'] = $stockInfo['oldStock'];
|
|
|
- $recordData['newStock'] = $stockInfo['newStock'];
|
|
|
- $recordData['productId'] = $itemId;
|
|
|
- $recordData['orderSn'] = $refundSn;
|
|
|
- $recordData['relateName'] = $shopAdminName;
|
|
|
- StockRecordClass::hdRefundAddRecord($recordData);
|
|
|
+ if ($bigNum > 0) {
|
|
|
+ $stockInfo = ProductClass::addStock($itemId, $bigNum, $smallNum);
|
|
|
+ $recordData = [];
|
|
|
+ $recordData['sjId'] = $sjId;
|
|
|
+ $recordData['shopId'] = $shopId;
|
|
|
+ $recordData['mainId'] = $mainId;
|
|
|
+ $recordData['itemId'] = $ptItemId;
|
|
|
+ $recordData['itemNum'] = ProductClass::mergeItemNum($bigNum, $smallNum, $ratio);
|
|
|
+ $recordData['oldStock'] = $stockInfo['oldStock'];
|
|
|
+ $recordData['newStock'] = $stockInfo['newStock'];
|
|
|
+ $recordData['productId'] = $itemId;
|
|
|
+ $recordData['orderSn'] = $refundSn;
|
|
|
+ $recordData['relateName'] = $shopAdminName;
|
|
|
+ StockRecordClass::hdRefundAddRecord($recordData);
|
|
|
+ }
|
|
|
|
|
|
return self::add($data);
|
|
|
}
|