mirror of
https://github.com/snowykami/neo-blog.git
synced 2025-09-26 11:06:23 +00:00
fix: 修复评论回复计数逻辑,确保正确显示评论的回复数量
This commit is contained in:
@ -88,7 +88,7 @@ func (cr *CommentRepo) CreateComment(comment *model.Comment) error {
|
||||
return err
|
||||
}
|
||||
parentComment.CommentCount += 1
|
||||
if err := tx.Save(&parentComment).Error; err != nil {
|
||||
if err := tx.Model(&parentComment).UpdateColumn("CommentCount", parentComment.CommentCount).Error; err != nil {
|
||||
return err
|
||||
}
|
||||
depth = parentComment.Depth + 1
|
||||
|
Reference in New Issue
Block a user