huangzhiguo před 1 rokem
rodič
revize
63b09baafe

+ 10 - 6
src/main/resources/mapper/svip/CmSvipHistoryDao.xml

@@ -756,7 +756,7 @@
                unit,
                normalPrice,
                stock,
-               costCheckFlag,
+               (select costCheckFlag from cm_organize_product_info where productId = cs.productId and organizeId = cs.organizeId ) as costCheckFlag,
                shopPercent AS costProportional,
                costPrice,
                price,
@@ -769,7 +769,7 @@
         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}
+        where cs.productId = #{productId} and cs.organizeId = 0
     </select>
     <select id="findLadderPriceBySku" resultType="com.caimei365.manager.entity.caimei.svip.CmLadderPrice">
         select skuId, productId, userType, ladderNum, buyNum, buyPrice, delFlag
@@ -840,10 +840,14 @@
     </select>
 
     <select id="findSku" resultType="com.caimei365.manager.entity.caimei.svip.CmSku">
-        select price, costPrice, costCheckFlag, shopPercent AS costProportional, normalPrice
-        from cm_sku
-        where productId = #{productId}
-        order by price asc
+        select cs.price,
+               cs.costPrice,
+               (select costCheckFlag from cm_organize_product_info where productId = cs.productId and organizeId = cs.organizeId ) as costCheckFlag,
+               cs.shopPercent AS costProportional,
+               cs.normalPrice
+        from cm_sku cs
+        where cs.productId = #{productId} and cs.organizeId = 0
+        order by cs.price asc
         limit 1
     </select>