作者 tangxvhui

调整 文章详情中的 已编辑标识

... ... @@ -110,8 +110,8 @@ func (l *MiniGetArticleLogic) MiniGetArticle(req *types.MiniArticleGetRequest) (
follow, _ := l.svcCtx.UserFollowRepository.FindOneUserFollowing(l.ctx, conn, int64(req.UserId), articleInfo.AuthorId)
queryOption = domain.NewQueryOptions().WithFindOnly().WithOffsetLimit(1, 1).WithKV("articleId", articleInfo.Id)
_, backupList, _ := l.svcCtx.ArticleBackupRepository.Find(l.ctx, conn, queryOption)
queryOption = domain.NewQueryOptions().WithCountOnly().WithOffsetLimit(1, 1).WithKV("articleId", articleInfo.Id)
backupCount, _, _ := l.svcCtx.ArticleBackupRepository.Find(l.ctx, conn, queryOption)
sortBy := domain.SortArticleSection(sectionList)
sort.Sort(sortBy)
... ... @@ -157,7 +157,7 @@ func (l *MiniGetArticleLogic) MiniGetArticle(req *types.MiniArticleGetRequest) (
MatchUrl: map[string]string{},
Videos: []types.Video{},
}
if len(backupList) > 0 {
if backupCount > 1 {
resp.Edit = 1
}
if author != nil {
... ...
... ... @@ -52,13 +52,6 @@ func (l *MiniDeleteArticleCommentLogic) MiniDeleteArticleComment(req *types.Mini
if err != nil {
return err
}
// 减少上级评论的回复数量
// if commentInfo.Pid != 0 {
// err = l.svcCtx.ArticleCommentRepository.IncreaseCountReply(l.ctx, c, -1, commentInfo.Pid)
// if err != nil {
// return err
// }
// }
// 减少最顶层的评论回复计数
// if commentInfo.TopId != 0 && commentInfo.Pid != commentInfo.TopId {
if commentInfo.TopId != 0 {
... ...
... ... @@ -80,15 +80,6 @@ func (l *SystemEditAticleCommentShowLogic) disableShow(commentId int64, companyI
if err != nil {
return err
}
// 减少上级评论的回复数量
// if commentInfo.Pid != 0 {
// err = l.svcCtx.ArticleCommentRepository.IncreaseCountReply(l.ctx, c, -1, commentInfo.Pid)
// if err != nil {
// return err
// }
// }
// 减少最顶层的评论回复计数
// if commentInfo.TopId != 0 && commentInfo.Pid != commentInfo.TopId {
if commentInfo.TopId != 0 {
err = l.svcCtx.ArticleCommentRepository.IncreaseCountReply(l.ctx, c, -1, commentInfo.TopId)
if err != nil {
... ... @@ -157,15 +148,8 @@ func (l *SystemEditAticleCommentShowLogic) enableShow(commentId int64, companyId
if err != nil {
return err
}
// 增加上级评论的回复数量
// if commetInfo.Pid != 0 {
// err = l.svcCtx.ArticleCommentRepository.IncreaseCountReply(l.ctx, c, 1, commetInfo.Pid)
// if err != nil {
// return err
// }
// }
// 增加最顶层的评论回复计数
// if commetInfo.TopId != 0 && commetInfo.Pid != commetInfo.TopId {
if commetInfo.TopId != 0 {
err = l.svcCtx.ArticleCommentRepository.IncreaseCountReply(l.ctx, c, 1, commetInfo.TopId)
if err != nil {
... ...