shish 4 years ago
parent
commit
bf21712c0f
1 changed files with 3 additions and 3 deletions
  1. 3 3
      biz-ghs/order/services/RefundOrderService.php

+ 3 - 3
biz-ghs/order/services/RefundOrderService.php

@@ -88,13 +88,13 @@ class RefundOrderService extends BaseService
                 if (empty($currentOrderItem)) {
                     util::fail('没有找到退款的花材');
                 }
-                $xhNum = $currentOrderItem->xhNum ?? 0;
+                $orderItemNum = $currentOrderItem->xhNum ?? 0;
                 $refundNum = $currentOrderItem->refundNum ?? 0;
 
                 $currentOrderItem->refundNum = bcadd($refundNum, $num);
                 $currentOrderItem->save();
 
-                $remainNum = bcsub($xhNum, $refundNum);
+                $remainNum = bcsub($orderItemNum, $refundNum);
                 if ($num > $remainNum) {
                     util::fail("{$name}超过可退数量");
                 }
@@ -113,7 +113,7 @@ class RefundOrderService extends BaseService
                     'itemId' => $ptItemId,
                     'itemCost' => $itemCost,
                     'itemNum' => $itemNum,
-                    'xhNum' => $xhNum,
+                    'xhNum' => $num,
                     'xhUnitName' => $xhUnitName,
                     'xhUnitType' => $unitType,
                     'xhUnitPrice' => $xhUnitPrice,