Sfoglia il codice sorgente

超级会员 零售获取价格方式修改

shish 3 anni fa
parent
commit
692e34a53c
1 ha cambiato i file con 4 aggiunte e 7 eliminazioni
  1. 4 7
      biz-mall/order/services/OrderService.php

+ 4 - 7
biz-mall/order/services/OrderService.php

@@ -83,6 +83,8 @@ class OrderService extends BaseService
         }
         $weight = 0;
         $goodsPrice = 0;
+        $priceMap = \bizGhs\custom\classes\CustomClass::$levelPriceKeyMap;
+        $addPriceMap = \bizGhs\custom\classes\CustomClass::$levelAddPriceKeyMap;
         foreach ($product as $key => $val) {
             if (isset($val['property']) == false) {
                 util::fail('没有找到产品属性');
@@ -126,6 +128,7 @@ class OrderService extends BaseService
                 OrderGoodsClass::addData($currentGoodsData);
             }
             if ($property == dict::getDict('property', 'item')) {
+                $currentItemInfo = $itemInfo[$currentId] ?? [];
                 $name = $itemInfo[$currentId]['name'] ?? '';
                 $cover = $itemInfo[$currentId]['cover'] ?? '';
                 if (!empty($groupCover)) {
@@ -133,13 +136,7 @@ class OrderService extends BaseService
                 }
                 $ratio = $itemInfo[$currentId]['ratio'] ?? 20;
                 $currentMainId = $itemInfo[$currentId]['mainId'] ?? 0;
-                $currentPrice = $itemInfo[$currentId]['skPrice'] ?? 0;
-                //折扣价
-                $discountPrice = $itemInfo[$currentId]['discountPrice'] ?? 0;
-                if ($discountPrice > 0) {
-                    $currentAddPrice = $itemInfo[$currentId]['skMore'] ?? 0;
-                    $currentPrice = bcadd($discountPrice, $currentAddPrice, 2);
-                }
+                $currentPrice = \bizGhs\product\classes\ProductClass::getFinalPrice($currentItemInfo, 0, $priceMap, $addPriceMap);
 
                 $currentWeight = $itemInfo[$currentId]['weight'] ?? 0;
                 if ($currentMainId != $mainId) {