mirror of
https://github.com/snowykami/neo-blog.git
synced 2025-09-03 15:56:22 +00:00
✨ feat: 更新评论功能,重构评论列表接口,添加分隔符组件,优化用户头像显示
This commit is contained in:
@ -190,7 +190,7 @@ func (cr *CommentRepo) ListComments(currentUserID uint, targetID uint, targetTyp
|
||||
query := GetDB().Model(&model.Comment{}).Preload("User")
|
||||
|
||||
if currentUserID > 0 {
|
||||
query = query.Where("is_private = ? OR (is_private = ? AND (user_id = ? OR user_id = ?))", false, true, currentUserID, masterID)
|
||||
query = query.Where("(is_private = ? OR (is_private = ? AND (user_id = ? OR user_id = ?)))", false, true, currentUserID, masterID)
|
||||
} else {
|
||||
query = query.Where("is_private = ?", false)
|
||||
}
|
||||
|
Reference in New Issue
Block a user