Browse Source

为你推荐-修复bug

zhangxin 4 tuần trước cách đây
mục cha
commit
4b26193d0c

+ 1 - 1
yami-shop-api/src/main/java/com/yami/shop/api/controller/ProdController.java

@@ -96,7 +96,7 @@ public class ProdController {
                     int num = userShopBehaviorService.findByUserIdCount(userId);
                     if (num < 6) {
                         userShopBehavior = new UserShopBehavior();
-                        userShopBehavior.setId(UUID.randomUUID().toString());
+//                        userShopBehavior.setId(UUID.randomUUID().toString());
                         userShopBehavior.setUserId(userId);
                         userShopBehavior.setShopId(shopId);
                         userShopBehavior.setProdId(prodId);

+ 2 - 2
yami-shop-service/src/main/resources/mapper/ProductMapper.xml

@@ -894,7 +894,7 @@
     </select>
 
     <select id="findByProdIdAndShopIdAndPrice" resultType="com.yami.shop.bean.app.dto.ProductDto">
-        SELECT DISTINCT
+        SELECT
         d.prod_id,
         d.shop_id,
         IFNULL(i.count,0)
@@ -905,7 +905,7 @@
         INNER JOIN tz_sku e on  d.prod_id  =  e.prod_id and e.is_delete=0 -- 商品规格表
         INNER JOIN tz_channel_prod f on  d.shop_id =f.shop_id and e.sku_id =f.sku_id and f.is_delete = 0  -- 渠道商品价格表
         and f.channel_prod_price &gt;=#{decreased} and  f.channel_prod_price &lt;=#{increased}
-        LEFT JOIN (SELECT count(h.order_item_id) as count,h.prod_id  from  tz_order g LEFT JOIN tz_order_item h on g.order_number = h.order_number where g.refund_status is null and g.delete_status and g.hb_order_status = 80) i on d.prod_id = i.prod_id -- 统计销量
+        LEFT JOIN (SELECT count(h.order_item_id) as count,h.prod_id  from  tz_order g LEFT JOIN tz_order_item h on g.order_number = h.order_number where g.refund_status is null and g.delete_status and g.hb_order_status = 80 GROUP BY h.prod_id) i on d.prod_id = i.prod_id -- 统计销量
         WHERE a.prod_id = #{prodId}
         AND d.shop_id = #{shopId}
         AND b.`level` = 2