shish 3 лет назад
Родитель
Сommit
b11905ed61
1 измененных файлов с 7 добавлено и 0 удалено
  1. 7 0
      biz-ghs/order/classes/OrderClass.php

+ 7 - 0
biz-ghs/order/classes/OrderClass.php

@@ -737,7 +737,14 @@ class OrderClass extends BaseClass
         $kind = 0;
         $itemStat = [];
         if (!empty($list)) {
+            $ids = array_column($list, 'productId');
+            $ids = array_filter(array_unique($ids));
+            $productInfo = ProductClass::getByIds($ids, null, 'id');
             foreach ($list as $key => $val) {
+                $productId = $val['productId'] ?? 0;
+                //当前花材的花店价
+                $currentPrice = $productInfo[$productId]['price'] ?? 0;
+                $list[$key]['currentHdPrice'] = $currentPrice;
                 $list[$key]['property'] = $val['rank'] . '级';
                 $price = $val['price'];
                 $totalPrice = stringUtil::calcAdd($totalPrice, $price);