This commit is contained in:
2025-10-08 17:16:25 +08:00
parent 4010910846
commit 2114f5d0f6

View File

@@ -119,7 +119,9 @@ public class JDInnerController {
}
// 获取本地可用的京东评论并统计
List<Comment> availableComments = commentRepository.findByProductIdAndPictureUrlsIsNotNull(productId);
// 查询未使用的评论isUse != 1即 isUse = 0 或 isUse is null
List<Comment> availableComments = commentRepository.findByProductIdAndIsUseNotAndPictureUrlsIsNotNull(productId, 1);
// 查询已使用的评论isUse != 0即 isUse = 1
List<Comment> usedComments = commentRepository.findByProductIdAndIsUseNotAndPictureUrlsIsNotNull(productId, 0);
canUseCommentCount = availableComments.size();
@@ -129,7 +131,9 @@ public class JDInnerController {
// 获取淘宝评论统计信息
HashMap<String, String> tbMap = jdUtil.getProductTypeMapForTB();
String taobaoProductId = tbMap.getOrDefault(productId, productId);
List<TaobaoComment> availableTbComments = taobaoCommentRepository.findByProductIdAndPictureUrlsIsNotNull(taobaoProductId);
// 查询未使用的淘宝评论isUse != 1
List<TaobaoComment> availableTbComments = taobaoCommentRepository.findByProductIdAndIsUseNotAndPictureUrlsIsNotNull(taobaoProductId, 1);
// 查询已使用的淘宝评论isUse != 0
List<TaobaoComment> usedTbComments = taobaoCommentRepository.findByProductIdAndIsUseNotAndPictureUrlsIsNotNull(taobaoProductId, 0);
canUseTbCommentCount = availableTbComments.size();
usedTbCommentCount = usedTbComments.size();