作者 zhuangmx

fixed:评论报错

... ... @@ -153,7 +153,7 @@ func (l *MiniSubscribeLogic) ReplyComment(conn transaction.Conn, article *domain
msg.ToUser = openId
msg.Page = fmt.Sprintf("/pages/detail/more-comment?id=%v", article.Id) //跳转页面 帖子评论聚合页
//备注
userCount, _ := l.svcCtx.ArticleCommentRepository.CommentUserCount(l.ctx, conn, comment.CompanyId, comment.ArticleId)
userCount, err := l.svcCtx.ArticleCommentRepository.CommentUserCount(l.ctx, conn, comment.CompanyId, comment.ArticleId)
msg.Data["thing9"] = &subscribe.DataItem{Value: fmt.Sprintf("您的帖子最近已有%v人评论,点击查看详情", userCount)}
//发送微信订阅消息
err = subCtx.Send(msg)
... ...
... ... @@ -444,7 +444,7 @@ func (repository *ArticleCommentRepository) CommentUserCount(ctx context.Context
tx = conn.DB()
c int64
)
err = tx.Model(&models.ArticleComment{}).Where("company_id = ? and article_id = ?", companyId, articleId).Group("user_id").Count(&c).Error
err = tx.Model(&models.ArticleComment{}).Where("company_id = ? and article_id = ?", companyId, articleId).Group("from_user_id").Count(&c).Error
return c, err
}
... ... @@ -455,7 +455,7 @@ func (repository *ArticleCommentRepository) ReplyUserCount(ctx context.Context,
tx = conn.DB()
c int64
)
err = tx.Model(&models.ArticleComment{}).Where("company_id = ? and pid = ?", companyId, commentId).Group("user_id").Count(&c).Error
err = tx.Model(&models.ArticleComment{}).Where("company_id = ? and pid = ?", companyId, commentId).Group("from_user_id").Count(&c).Error
return c, err
}
... ...