Browse Source

fix:限时折扣的

super-yimizi 1 month ago
parent
commit
ae2367a144

+ 2 - 1
application/api/controller/Goods.php

@@ -355,7 +355,8 @@ class Goods extends Base
                 $sku['discount'] = $discountInfo['discount'];
                 $sku['discount_price'] = $discountInfo['discount_price'];
                 $sku['discount_stocks'] = $discountInfo['discount_stocks'];
-                $sku['discount_amount'] = round($sku['original_price'] - $discountInfo['discount_price'], 2);
+                // 计算优惠金额:原价 - 折扣价 = 用户节省的金额
+                $sku['discount_amount'] =$discountInfo['discount_price'];
             } else {
                 // 没有参与折扣活动的SKU
                 $sku['has_discount'] = false;

+ 1 - 1
application/common/Service/OrderService.php

@@ -456,7 +456,7 @@ class OrderService
         }
         
         $orderInfo['pay_amount']          =  bcsub($orderInfo['order_amount'], $orderInfo['discount_fee'], 2);
-        $orderInfo['pay_original_amount'] =   $orderInfo['pay_amount'];
+        $orderInfo['pay_original_amount'] =  $orderInfo['pay_amount'];
         $orderInfo['pay_remain_amount']   =  $orderInfo['pay_amount']; 
         // echo "<pre>";
         // print_r($orderInfo);

+ 1 - 1
application/common/service/OrderService.php

@@ -456,7 +456,7 @@ class OrderService
         }
         
         $orderInfo['pay_amount']          =  bcsub($orderInfo['order_amount'], $orderInfo['discount_fee'], 2);
-        $orderInfo['pay_original_amount'] =   $orderInfo['pay_amount'];
+        $orderInfo['pay_original_amount'] =  $orderInfo['pay_amount'];
         $orderInfo['pay_remain_amount']   =  $orderInfo['pay_amount']; 
         // echo "<pre>";
         // print_r($orderInfo);