Skip to content

Commit

Permalink
fix: 修复用户评论记录为空导致用户成就获取失败问题
Browse files Browse the repository at this point in the history
  • Loading branch information
Liusiyuan-git committed Jan 27, 2023
1 parent c83c12b commit 0f085f5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/comment/service/internal/data/comment.go
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ func (r *commentRepo) getCommentUserFromCache(ctx context.Context, key string) (
func (r *commentRepo) getCommentUserFromDB(ctx context.Context, uuid string) (*biz.CommentUser, error) {
cu := &CommentUser{}
err := r.data.db.WithContext(ctx).Select("comment", "article_reply", "article_reply_sub", "talk_reply", "talk_reply_sub", "article_replied", "article_replied_sub", "talk_replied", "talk_replied_sub").Where("uuid = ?", uuid).First(cu).Error
if err != nil {
if !errors.Is(err, gorm.ErrRecordNotFound) && err != nil {
return nil, errors.Wrapf(err, fmt.Sprintf("faile to get comment user from db: uuid(%v)", uuid))
}
return &biz.CommentUser{
Expand Down

0 comments on commit 0f085f5

Please sign in to comment.