瀏覽代碼

成本价的启用

shish 7 月之前
父節點
當前提交
4ec741061d
共有 1 個文件被更改,包括 12 次插入2 次删除
  1. 12 2
      biz-ghs/product/classes/ProductClass.php

+ 12 - 2
biz-ghs/product/classes/ProductClass.php

@@ -754,8 +754,18 @@ class ProductClass extends BaseClass
         if (empty($product) || isset($product['price']) == false) {
             return 0;
         }
-        $currentPriceField = $priceMap[$level] ?? 'price';
-        $price = $product[$currentPriceField] ?? 0;
+        if ($level == 9) {
+            $avCost = $product['avCost'] ?? 0;
+            $price = $avCost;
+            if ($price <= 0) {
+                $cost = $product['cost'] ?? 0;
+                $price = $cost;
+            }
+        } else {
+            $currentPriceField = $priceMap[$level] ?? 'price';
+            $price = $product[$currentPriceField] ?? 0;
+        }
+
         $discountPrice = $product['discountPrice'] ?? 0;
         $hjDiscountPrice = $product['hjDiscountPrice'] ?? 0;
         $skDiscountPrice = $product['skDiscountPrice'] ?? 0;