Browse Source

修复评论列表reviewType过滤不生效问题

codingliang 2 years ago
parent
commit
2cf7961e35

+ 1 - 0
src/main/java/com/study/mall/service/impl/GoodsCommentServiceImpl.java

@@ -56,6 +56,7 @@ public class GoodsCommentServiceImpl extends ServiceImpl<GoodsCommentDao, GoodsC
         queryWrapper.eq(dto.getOrderId() != null, GoodsCommentEntity::getOrderId, dto.getOrderId());
         queryWrapper.eq(dto.getUserId() != null, GoodsCommentEntity::getUserId, dto.getUserId());
         queryWrapper.eq(dto.getSkuId() != null, GoodsCommentEntity::getSkuId, dto.getSkuId());
+        queryWrapper.eq(StringUtils.hasText(dto.getReviewType()), GoodsCommentEntity::getReviewType, dto.getReviewType());
         if (StringUtils.hasText(dto.getHasImg())) {
             if ("1".equals(dto.getHasImg())) {
                 queryWrapper.isNotNull(GoodsCommentEntity::getReviewImgs);