Browse Source

优惠价bugfix

zhijiezhao 2 years ago
parent
commit
699803a480

+ 2 - 2
src/main/java/com/caimei365/commodity/components/PriceUtilService.java

@@ -186,8 +186,8 @@ public class PriceUtilService {
                     // 单品优惠价的时候,取当前sku的touchprice
                     Double touchPrice = priceMapper.getTouchPriceBySku(s.getSkuId(), promotions.getId());
                     s.setPrice(touchPrice);
-                    price.setPrice(skus.get(0).getTouchPrice());
-                    promotions.setTouchPrice(skus.get(0).getTouchPrice());
+                    price.setPrice(touchPrice);
+                    promotions.setTouchPrice(touchPrice);
                 }
                 price.setPromotions(promotions);
             } else {

+ 0 - 2
src/main/resources/mapper/PriceMapper.xml

@@ -198,12 +198,10 @@
                                      WHERE skuId = cs.skuId
                                      ORDER BY buyNum asc
                                      LIMIT 1))                                                                      AS minBuyNumber,
-               cps.touchPrice,
                csps.priceType,
                csps.discountPrice,
                csps.discount
         from cm_sku cs
-        left join cm_promotion_sku cps on cs.skuId = cps.skuId
         left join cm_svip_product_sku csps on cs.skuId = csps.skuId
         where cs.productId = #{productId}
         ORDER BY cs.price ASC