From 4bff26f84eea567dfc65564285dc84fc46b22498 Mon Sep 17 00:00:00 2001 From: Administrator <15274802129@163.com> Date: Fri, 16 May 2025 17:15:37 +0800 Subject: [PATCH] refactor(mall): 优化商品评论数量查询逻辑 --- src/main/java/cc/mrbird/febs/mall/service/impl/ApiMallGoodsServiceImpl.java | 5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main/java/cc/mrbird/febs/mall/service/impl/ApiMallGoodsServiceImpl.java b/src/main/java/cc/mrbird/febs/mall/service/impl/ApiMallGoodsServiceImpl.java index 1e2d6e1..c3e54e8 100644 --- a/src/main/java/cc/mrbird/febs/mall/service/impl/ApiMallGoodsServiceImpl.java +++ b/src/main/java/cc/mrbird/febs/mall/service/impl/ApiMallGoodsServiceImpl.java @@ -145,8 +145,9 @@ } mallGoodsDetailsVo.setImages(images); - QueryWrapper<MallGoodsComment> objectQueryWrapper = new QueryWrapper<>(); - objectQueryWrapper.eq("goods_id",id); + LambdaQueryWrapper<MallGoodsComment> objectQueryWrapper = new LambdaQueryWrapper<>(); + objectQueryWrapper.eq(MallGoodsComment::getGoodsId,id); + objectQueryWrapper.eq(MallGoodsComment::getShowState,1); Integer commentCount = mallGoodsCommentMapper.selectCount(objectQueryWrapper); mallGoodsDetailsVo.setCommentCount(commentCount); return mallGoodsDetailsVo; -- Gitblit v1.9.1