作者 zhuangmx

fixed:评论报错

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