浏览代码

商品编辑

huangzhiguo 2 年之前
父节点
当前提交
fc9e97de54

+ 1 - 0
src/main/java/com/caimei/modules/product/dao/ProductDao.java

@@ -203,6 +203,7 @@ public interface ProductDao extends CrudDao<Product> {
     void deleteSkus(Integer productID);
 
     List<CmSku> findSkuList(Integer productID);
+    List<CmSku> findSkuListProduct(Integer productID);
 
     List<CmLadderPrice> findLadderPriceBySku(Integer skuId);
 

+ 1 - 1
src/main/java/com/caimei/modules/product/service/ProductService.java

@@ -672,7 +672,7 @@ public class ProductService extends CrudService<ProductDao, Product> {
     }
 
     public List<CmSku> findSkuList(Integer productID) {
-        List<CmSku> skus = productDao.findSkuList(productID);
+        List<CmSku> skus = productDao.findSkuListProduct(productID);
         skus.forEach(s -> {
             s.ladderPriceList(productDao.findLadderPriceBySku(s.skuId()));
         });

+ 19 - 0
src/main/resources/mappings/modules/product/ProductMapper.xml

@@ -2041,6 +2041,25 @@
         left join cm_svip_product_sku csps on cs.skuId = csps.skuId
         where cs.productId = #{productID}
     </select>
+    <select id="findSkuListProduct" resultType="com.caimei.modules.product.entity.CmSku">
+        select cs.skuId,
+               cs.productId,
+               unit,
+               normalPrice,
+               stock,
+               costCheckFlag,
+               costProportional,
+               costPrice,
+               price,
+               ladderPriceFlag,
+               minBuyNumber,
+               csps.discount,
+               csps.discountPrice,
+               csps.priceType
+        from cm_sku cs
+        left join cm_svip_product_sku csps on cs.skuId = csps.skuId
+        where cs.productId = #{productID}
+    </select>
     <select id="findLadderPriceBySku" resultType="com.caimei.modules.product.entity.CmLadderPrice">
         select skuId, productId, userType, ladderNum, buyNum, buyPrice, delFlag
         FROM product_ladder_price