正在显示
3 个修改的文件
包含
4 行增加
和
27 行删除
@@ -110,8 +110,8 @@ func (l *MiniGetArticleLogic) MiniGetArticle(req *types.MiniArticleGetRequest) ( | @@ -110,8 +110,8 @@ func (l *MiniGetArticleLogic) MiniGetArticle(req *types.MiniArticleGetRequest) ( | ||
110 | 110 | ||
111 | follow, _ := l.svcCtx.UserFollowRepository.FindOneUserFollowing(l.ctx, conn, int64(req.UserId), articleInfo.AuthorId) | 111 | follow, _ := l.svcCtx.UserFollowRepository.FindOneUserFollowing(l.ctx, conn, int64(req.UserId), articleInfo.AuthorId) |
112 | 112 | ||
113 | - queryOption = domain.NewQueryOptions().WithFindOnly().WithOffsetLimit(1, 1).WithKV("articleId", articleInfo.Id) | ||
114 | - _, backupList, _ := l.svcCtx.ArticleBackupRepository.Find(l.ctx, conn, queryOption) | 113 | + queryOption = domain.NewQueryOptions().WithCountOnly().WithOffsetLimit(1, 1).WithKV("articleId", articleInfo.Id) |
114 | + backupCount, _, _ := l.svcCtx.ArticleBackupRepository.Find(l.ctx, conn, queryOption) | ||
115 | 115 | ||
116 | sortBy := domain.SortArticleSection(sectionList) | 116 | sortBy := domain.SortArticleSection(sectionList) |
117 | sort.Sort(sortBy) | 117 | sort.Sort(sortBy) |
@@ -157,7 +157,7 @@ func (l *MiniGetArticleLogic) MiniGetArticle(req *types.MiniArticleGetRequest) ( | @@ -157,7 +157,7 @@ func (l *MiniGetArticleLogic) MiniGetArticle(req *types.MiniArticleGetRequest) ( | ||
157 | MatchUrl: map[string]string{}, | 157 | MatchUrl: map[string]string{}, |
158 | Videos: []types.Video{}, | 158 | Videos: []types.Video{}, |
159 | } | 159 | } |
160 | - if len(backupList) > 0 { | 160 | + if backupCount > 1 { |
161 | resp.Edit = 1 | 161 | resp.Edit = 1 |
162 | } | 162 | } |
163 | if author != nil { | 163 | if author != nil { |
@@ -52,13 +52,6 @@ func (l *MiniDeleteArticleCommentLogic) MiniDeleteArticleComment(req *types.Mini | @@ -52,13 +52,6 @@ func (l *MiniDeleteArticleCommentLogic) MiniDeleteArticleComment(req *types.Mini | ||
52 | if err != nil { | 52 | if err != nil { |
53 | return err | 53 | return err |
54 | } | 54 | } |
55 | - // 减少上级评论的回复数量 | ||
56 | - // if commentInfo.Pid != 0 { | ||
57 | - // err = l.svcCtx.ArticleCommentRepository.IncreaseCountReply(l.ctx, c, -1, commentInfo.Pid) | ||
58 | - // if err != nil { | ||
59 | - // return err | ||
60 | - // } | ||
61 | - // } | ||
62 | // 减少最顶层的评论回复计数 | 55 | // 减少最顶层的评论回复计数 |
63 | // if commentInfo.TopId != 0 && commentInfo.Pid != commentInfo.TopId { | 56 | // if commentInfo.TopId != 0 && commentInfo.Pid != commentInfo.TopId { |
64 | if commentInfo.TopId != 0 { | 57 | if commentInfo.TopId != 0 { |
@@ -80,15 +80,6 @@ func (l *SystemEditAticleCommentShowLogic) disableShow(commentId int64, companyI | @@ -80,15 +80,6 @@ func (l *SystemEditAticleCommentShowLogic) disableShow(commentId int64, companyI | ||
80 | if err != nil { | 80 | if err != nil { |
81 | return err | 81 | return err |
82 | } | 82 | } |
83 | - // 减少上级评论的回复数量 | ||
84 | - // if commentInfo.Pid != 0 { | ||
85 | - // err = l.svcCtx.ArticleCommentRepository.IncreaseCountReply(l.ctx, c, -1, commentInfo.Pid) | ||
86 | - // if err != nil { | ||
87 | - // return err | ||
88 | - // } | ||
89 | - // } | ||
90 | - // 减少最顶层的评论回复计数 | ||
91 | - // if commentInfo.TopId != 0 && commentInfo.Pid != commentInfo.TopId { | ||
92 | if commentInfo.TopId != 0 { | 83 | if commentInfo.TopId != 0 { |
93 | err = l.svcCtx.ArticleCommentRepository.IncreaseCountReply(l.ctx, c, -1, commentInfo.TopId) | 84 | err = l.svcCtx.ArticleCommentRepository.IncreaseCountReply(l.ctx, c, -1, commentInfo.TopId) |
94 | if err != nil { | 85 | if err != nil { |
@@ -157,15 +148,8 @@ func (l *SystemEditAticleCommentShowLogic) enableShow(commentId int64, companyId | @@ -157,15 +148,8 @@ func (l *SystemEditAticleCommentShowLogic) enableShow(commentId int64, companyId | ||
157 | if err != nil { | 148 | if err != nil { |
158 | return err | 149 | return err |
159 | } | 150 | } |
160 | - // 增加上级评论的回复数量 | ||
161 | - // if commetInfo.Pid != 0 { | ||
162 | - // err = l.svcCtx.ArticleCommentRepository.IncreaseCountReply(l.ctx, c, 1, commetInfo.Pid) | ||
163 | - // if err != nil { | ||
164 | - // return err | ||
165 | - // } | ||
166 | - // } | 151 | + |
167 | // 增加最顶层的评论回复计数 | 152 | // 增加最顶层的评论回复计数 |
168 | - // if commetInfo.TopId != 0 && commetInfo.Pid != commetInfo.TopId { | ||
169 | if commetInfo.TopId != 0 { | 153 | if commetInfo.TopId != 0 { |
170 | err = l.svcCtx.ArticleCommentRepository.IncreaseCountReply(l.ctx, c, 1, commetInfo.TopId) | 154 | err = l.svcCtx.ArticleCommentRepository.IncreaseCountReply(l.ctx, c, 1, commetInfo.TopId) |
171 | if err != nil { | 155 | if err != nil { |
-
请 注册 或 登录 后发表评论