zhijiezhao vor 2 Jahren
Ursprung
Commit
9aed8fa0cf

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

@@ -14,9 +14,9 @@
 
 
     <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 cm_club_report cmc ON cmc.productID = p.productID
         <where>

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

@@ -166,10 +166,10 @@
             cpg.number as number,
             0 as price,
             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.stock as stock
+            (select stock from cm_sku where productId=p.productId order by price asc limit 1)as stock
         from product p
         left join cm_promotions_gift cpg on cpg.productId = p.productID
         where cpg.promotionsId = #{promotionsId}