Browse Source

商品按标签过滤

chunping 3 years ago
parent
commit
c0c6c56559

+ 1 - 1
mp-admin/src/main/java/com/qs/mp/web/controller/api/admin/GoodsMgrController.java

@@ -110,7 +110,7 @@ public class GoodsMgrController extends BaseApiController {
     queryWrapper.lambda()
         .eq(null != queryParam.getCategoryId(), Goods::getCategoryId, queryParam.getCategoryId());
     // 标签过滤的商品ID
-    queryWrapper.lambda().eq(!CollectionUtils.isEmpty(goodsIds), Goods::getGoodsId, goodsIds);
+    queryWrapper.lambda().in(null != queryParam.getTagId(), Goods::getGoodsId, goodsIds);
     queryWrapper.lambda().eq(Goods::getIsDeleted, 0);
     queryWrapper.orderByAsc("FIELD(`status`, 'init', 'on', 'off')");
     queryWrapper.lambda().orderByDesc(Goods::getGoodsId);