作者 郑周

Merge branch 'dev' into test

... ... @@ -169,7 +169,7 @@ func (l *MiniBusinessLogic) MiniBusiness(req *types.MessageRequest, msgType doma
CreatedAt: item.CreatedAt,
}
if v, ok := userIdMap[item.UserId]; ok {
if v, ok := userIdMap[item.UserId]; ok && v != nil {
to.User = &types.SimpleUser{
Id: v.Id,
CompanyId: v.CompanyId,
... ... @@ -178,12 +178,12 @@ func (l *MiniBusinessLogic) MiniBusiness(req *types.MessageRequest, msgType doma
Avatar: v.Avatar,
}
if v, ok := companyIdMap[item.CompanyId]; ok {
if v, ok := companyIdMap[item.CompanyId]; ok && v != nil {
to.User.CompanyName = v.Name
}
}
if v, ok := articleIdMap[item.ArticleId]; ok {
if v, ok := articleIdMap[item.ArticleId]; ok && v != nil {
to.Article = &types.SimpleArticle{
Id: v.Id,
Title: v.Title,
... ... @@ -193,7 +193,7 @@ func (l *MiniBusinessLogic) MiniBusiness(req *types.MessageRequest, msgType doma
}
}
if v, ok := commentIdMap[item.CommentId]; ok {
if v, ok := commentIdMap[item.CommentId]; ok && v != nil {
to.Comment = &types.SimpleComment{
Id: v.Id,
Content: v.Content,
... ...
... ... @@ -127,6 +127,9 @@ func (repository *ArticleCommentRepository) Find(ctx context.Context, conn trans
if v, ok := queryOptions["topId"]; ok {
tx = tx.Where("top_id=?", v)
}
if v, ok := queryOptions["ids"]; ok {
tx = tx.Where("id in (?)", v)
}
if v, ok := queryOptions["show"]; ok {
tx = tx.Where("show=?", v)
}
... ...