zhijiezhao 2 年之前
父節點
當前提交
9aed8fa0cf
共有 2 個文件被更改,包括 6 次插入6 次删除
  1. 3 3
      src/main/resources/mapper/ClubReport.xml
  2. 3 3
      src/main/resources/mapper/ShopMapper.xml

+ 3 - 3
src/main/resources/mapper/ClubReport.xml

@@ -14,9 +14,9 @@
 
 
 
 
     <select id="productList" resultType="com.caimei365.user.model.vo.ProductItemVo">
     <select id="productList" resultType="com.caimei365.user.model.vo.ProductItemVo">
-        SELECT DISTINCT
-                p.productID as productId,p.mainImage as image,p.name,p.price,s.name as shopName
-        FROM `product` p
+        SELECT DISTINCT p.productID as productId,p.mainImage as image,p.name,
+        (select price from cm_sku where productId=p.productId order by price asc limit 1)as price,s.name as shopName
+        FROM product p
         LEFT JOIN shop s ON s.shopID = p.shopID
         LEFT JOIN shop s ON s.shopID = p.shopID
         LEFT JOIN cm_club_report cmc ON cmc.productID = p.productID
         LEFT JOIN cm_club_report cmc ON cmc.productID = p.productID
         <where>
         <where>

+ 3 - 3
src/main/resources/mapper/ShopMapper.xml

@@ -166,10 +166,10 @@
             cpg.number as number,
             cpg.number as number,
             0 as price,
             0 as price,
             2 as productType,
             2 as productType,
-            p.price as originalPrice,
-            p.unit as unit,
+            (select price from cm_sku where productId=p.productId order by price asc limit 1)as originalPrice,
+            (select unit from cm_sku where productId=p.productId order by price asc limit 1)as unit,
             p.validFlag as validFlag,
             p.validFlag as validFlag,
-            p.stock as stock
+            (select stock from cm_sku where productId=p.productId order by price asc limit 1)as stock
         from product p
         from product p
         left join cm_promotions_gift cpg on cpg.productId = p.productID
         left join cm_promotions_gift cpg on cpg.productId = p.productID
         where cpg.promotionsId = #{promotionsId}
         where cpg.promotionsId = #{promotionsId}