|
|
@@ -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 >=#{decreased} and f.channel_prod_price <=#{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
|