Commit e0c4e9edf807a565f96340aaa648262acfe074aa
1 parent
2fbb0ddf
fix XTRADE-48 商品库存为0不展示
Showing
1 changed file
with
2 additions
and
1 deletions
etrade-shop/src/main/resources/com/diligrp/etrade/dao/mapper/ProductMapper.xml
@@ -361,7 +361,7 @@ | @@ -361,7 +361,7 @@ | ||
361 | </choose> | 361 | </choose> |
362 | </select> | 362 | </select> |
363 | 363 | ||
364 | - <!-- 查询商品主键集合 - 商品库存列表 取状态=待审核+审核通过的,且有库存的商品 --> | 364 | + <!-- 查询商品主键集合 - 商品库存列表 取状态=待审核+审核通过的,且库存>0的商品 --> |
365 | <select id="pageIdStockV2" resultType="java.lang.Long"> | 365 | <select id="pageIdStockV2" resultType="java.lang.Long"> |
366 | SELECT | 366 | SELECT |
367 | DISTINCT p.id | 367 | DISTINCT p.id |
@@ -371,6 +371,7 @@ | @@ -371,6 +371,7 @@ | ||
371 | INNER JOIN stock st ON st.product_id = p.id | 371 | INNER JOIN stock st ON st.product_id = p.id |
372 | WHERE p.deleted = 1 | 372 | WHERE p.deleted = 1 |
373 | AND pa.state != 2 | 373 | AND pa.state != 2 |
374 | + AND st.stock > 0 | ||
374 | <include refid="listWhere"/> | 375 | <include refid="listWhere"/> |
375 | ORDER BY p.modified_time DESC, id DESC | 376 | ORDER BY p.modified_time DESC, id DESC |
376 | </select> | 377 | </select> |