shish 2 سال پیش
والد
کامیت
c1ae9e7a44
2فایلهای تغییر یافته به همراه6 افزوده شده و 1 حذف شده
  1. 1 1
      app-ghs/controllers/OrderItemController.php
  2. 5 0
      biz-ghs/order/classes/OrderItemClass.php

+ 1 - 1
app-ghs/controllers/OrderItemController.php

@@ -44,7 +44,7 @@ class OrderItemController extends BaseController
         try {
             $delInfo->delete();
             $new = [];
-            $new[$productId] = ['num' => $num, 'productId' => $productId];
+            $new[$productId] = ['num' => $num, 'productId' => $productId, 'price' => $price];
             OrderItemClass::bookAddItem($order, $new);
             $transaction->commit();
             util::complete('更换成功');

+ 5 - 0
biz-ghs/order/classes/OrderItemClass.php

@@ -76,6 +76,7 @@ class OrderItemClass extends BaseClass
         $productList = [];
         foreach ($itemList as $item) {
             $num = $item['num'] ?? 0;
+            $price = $item['price'] ?? 0;
             $productId = $item['productId'] ?? 0;
             $info = $addInfo[$productId] ?? [];
             $current = [];
@@ -110,6 +111,10 @@ class OrderItemClass extends BaseClass
             $current['xhPreNum'] = $num;
             $current['xhPreUnitName'] = $info['bigUnit'] ?? '';
             $current['xhPreUnitType'] = 0;
+            if ($price > 0) {
+                $current['xhUnitPrice'] = $price;
+                $current['xhPreUnitPrice'] = $price;
+            }
             $current['itemInfo'] = '';
             self::add($current);