|
|
@@ -164,6 +164,17 @@ public class StoreCommentServiceImpl extends ServiceImpl<StoreCommentMapper, Sto
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ // 回复状态筛选:在分页查询前加入SQL条件,保证「未回复」只显示未回复数据、总数和分页正确
|
|
|
+ if (replyStatus != null && (replyStatus == 1 || replyStatus == 2)) {
|
|
|
+ if (replyStatus == 1) {
|
|
|
+ // 已回复:存在商家回复(子评论中 phone_id 含 store_)
|
|
|
+ queryWrapper.apply("EXISTS (SELECT 1 FROM store_comment r WHERE r.reply_id = a.id AND r.phone_id LIKE '%store%' AND r.delete_flag = 0)");
|
|
|
+ } else if (replyStatus == 2) {
|
|
|
+ // 未回复:不存在商家回复
|
|
|
+ queryWrapper.apply("NOT EXISTS (SELECT 1 FROM store_comment r WHERE r.reply_id = a.id AND r.phone_id LIKE '%store%' AND r.delete_flag = 0)");
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
//先查询父级评论
|
|
|
queryWrapper.isNull(businessType != 1, "a.reply_id").eq("a.delete_flag", 0).orderByDesc("a.created_time");
|
|
|
IPage<StoreCommentVo> page = storeCommentMapper.getCommentPage(storeCommentIPage, queryWrapper);
|