shish 4 лет назад
Родитель
Сommit
48db406e56
1 измененных файлов с 4 добавлено и 2 удалено
  1. 4 2
      biz-hd/order/services/OrderService.php

+ 4 - 2
biz-hd/order/services/OrderService.php

@@ -118,13 +118,15 @@ class OrderService extends BaseService
             if (isset($val['property']) == false) {
                 util::fail('没有找到产品属性');
             }
-            $currentPrice = $val['price'] ?? 0;
-            $goodsPrice = bcadd($goodsPrice, $currentPrice, 2);
             $property = $val['property'];
             $unitPrice = $val['unitPrice'] ?? 0;
             $unitType = $val['unitType'] ?? 0;
             $currentId = $val['productId'] ?? 0;
             $num = $val['num'] ?? 0;
+
+            $currentPrice = bcmul($unitPrice, $num, 2);
+            $goodsPrice = bcadd($goodsPrice, $currentPrice, 2);
+
             if ($property == dict::getDict('property', 'goods')) {
                 $name = $goodsInfo[$currentId]['name'] ?? '';
                 $cover = $goodsInfo[$currentId]['cover'] ?? '';