shish 9 months ago
parent
commit
bbf7cd81ee
1 changed files with 11 additions and 0 deletions
  1. 11 0
      biz-hd/product/classes/ProductClass.php

+ 11 - 0
biz-hd/product/classes/ProductClass.php

@@ -291,6 +291,8 @@ class ProductClass extends BaseClass
 
     public static function partItemGroup($list, $level = 0)
     {
+        $priceMap = \bizGhs\custom\classes\CustomClass::$levelPriceKeyMap;
+        $addPriceMap = \bizGhs\custom\classes\CustomClass::$levelAddPriceKeyMap;
         foreach ($list as $k => $v) {
             $shortCover = $v['cover'] ?? '';
 
@@ -300,6 +302,15 @@ class ProductClass extends BaseClass
             $list[$k]['smallNum'] = $stockInfo['smallNum'];
 
             $list[$k]['cover'] = imgUtil::groupImg($shortCover) . "?x-oss-process=image/resize,m_fill,h_100,w_100";
+
+            $price = \bizGhs\product\classes\ProductClass::getFinalPrice($v, $level, $priceMap, $addPriceMap);
+            $list[$k]['price'] = $price;
+            $list[$k]['bigPrice'] = $price;
+            $smallRatio = $v['smallRatio'] ?? 0;
+            $smallPrice = bcdiv($price, $ratio, 2);
+            $smallPrice = bcmul($smallPrice, $smallRatio, 2);
+            $list[$k]['smallPrice'] = $smallPrice;
+
         }
         return $list;
     }