Przeglądaj źródła

列出保存的价格

shish 2 lat temu
rodzic
commit
7c555e8a4b
1 zmienionych plików z 8 dodań i 3 usunięć
  1. 8 3
      biz-ghs/order/classes/OrderClass.php

+ 8 - 3
biz-ghs/order/classes/OrderClass.php

@@ -857,6 +857,7 @@ class OrderClass extends BaseClass
         $totalBigNum = 0;
         $totalBigNum = 0;
         $totalSmallNum = 0;
         $totalSmallNum = 0;
         $kind = 0;
         $kind = 0;
+        $bookSavePrice = $order['bookSavePrice'] ?? 0;
         $itemStat = [];
         $itemStat = [];
         if (!empty($list)) {
         if (!empty($list)) {
             $ids = array_column($list, 'productId');
             $ids = array_column($list, 'productId');
@@ -866,10 +867,14 @@ class OrderClass extends BaseClass
                 $productId = $val['productId'] ?? 0;
                 $productId = $val['productId'] ?? 0;
                 $currentInfo = $productInfo[$productId];
                 $currentInfo = $productInfo[$productId];
                 $currentPrice = $productInfo[$productId]['price'] ?? 0;
                 $currentPrice = $productInfo[$productId]['price'] ?? 0;
-                $list[$key]['currentHdPrice'] = floatval($currentPrice);
+                if ($bookSavePrice == 0) {
+                    $list[$key]['currentHdPrice'] = floatval($currentPrice);
+                } else {
+                    $list[$key]['currentHdPrice'] = $list['xhUnitPrice'] ?? 0;
+                }
                 $list[$key]['property'] = '';
                 $list[$key]['property'] = '';
-                $list[$key]['cost'] = $currentInfo['cost']??0;
-                $list[$key]['stock'] = $currentInfo['stock'] ? floatval($currentInfo['stock']):0;
+                $list[$key]['cost'] = $currentInfo['cost'] ?? 0;
+                $list[$key]['stock'] = $currentInfo['stock'] ? floatval($currentInfo['stock']) : 0;
                 $price = $val['price'];
                 $price = $val['price'];
                 $totalPrice = stringUtil::calcAdd($totalPrice, $price);
                 $totalPrice = stringUtil::calcAdd($totalPrice, $price);
                 $kind++;
                 $kind++;