shish 3 лет назад
Родитель
Сommit
0953dbf45f
1 измененных файлов с 2 добавлено и 2 удалено
  1. 2 2
      biz-hd/goods/classes/GoodsClass.php

+ 2 - 2
biz-hd/goods/classes/GoodsClass.php

@@ -117,7 +117,7 @@ class GoodsClass extends BaseClass
             $sendCost = $data['sendCost'] ?? 0;
             $shopImg = $data['shopImg'] ?? [];
             if ($sendCost > 0) {
-                $div = bcmul($sendCost, $num, 2);
+                $div = bcdiv($sendCost, $num, 2);
                 $cgPrice = bcadd($cgPrice, $div, 2);
             }
             $cover = isset($shopImg[0]) ? $shopImg[0] : '';
@@ -192,7 +192,7 @@ class GoodsClass extends BaseClass
             $cover = $postGoods['cover'] ?? '';
             $num = $postGoods['num'] ?? 0;
             $totalNum = bcadd($num, $totalNum);
-            $cgPrice = $postGoods['cgPrice'] ?? 0;
+            $cgPrice = $postGoods['price'] ?? 0;
             $salePrice = $postGoods['salePrice'] ?? 0;
             if (empty($salePrice)) {
                 $salePrice = $goodsInfo[$goodsId]['price'] ?? 0;