作者 郑周

Merge branch 'dev' into test

@@ -169,7 +169,7 @@ func (l *MiniBusinessLogic) MiniBusiness(req *types.MessageRequest, msgType doma @@ -169,7 +169,7 @@ func (l *MiniBusinessLogic) MiniBusiness(req *types.MessageRequest, msgType doma
169 CreatedAt: item.CreatedAt, 169 CreatedAt: item.CreatedAt,
170 } 170 }
171 171
172 - if v, ok := userIdMap[item.UserId]; ok { 172 + if v, ok := userIdMap[item.UserId]; ok && v != nil {
173 to.User = &types.SimpleUser{ 173 to.User = &types.SimpleUser{
174 Id: v.Id, 174 Id: v.Id,
175 CompanyId: v.CompanyId, 175 CompanyId: v.CompanyId,
@@ -178,12 +178,12 @@ func (l *MiniBusinessLogic) MiniBusiness(req *types.MessageRequest, msgType doma @@ -178,12 +178,12 @@ func (l *MiniBusinessLogic) MiniBusiness(req *types.MessageRequest, msgType doma
178 Avatar: v.Avatar, 178 Avatar: v.Avatar,
179 } 179 }
180 180
181 - if v, ok := companyIdMap[item.CompanyId]; ok { 181 + if v, ok := companyIdMap[item.CompanyId]; ok && v != nil {
182 to.User.CompanyName = v.Name 182 to.User.CompanyName = v.Name
183 } 183 }
184 } 184 }
185 185
186 - if v, ok := articleIdMap[item.ArticleId]; ok { 186 + if v, ok := articleIdMap[item.ArticleId]; ok && v != nil {
187 to.Article = &types.SimpleArticle{ 187 to.Article = &types.SimpleArticle{
188 Id: v.Id, 188 Id: v.Id,
189 Title: v.Title, 189 Title: v.Title,
@@ -193,7 +193,7 @@ func (l *MiniBusinessLogic) MiniBusiness(req *types.MessageRequest, msgType doma @@ -193,7 +193,7 @@ func (l *MiniBusinessLogic) MiniBusiness(req *types.MessageRequest, msgType doma
193 } 193 }
194 } 194 }
195 195
196 - if v, ok := commentIdMap[item.CommentId]; ok { 196 + if v, ok := commentIdMap[item.CommentId]; ok && v != nil {
197 to.Comment = &types.SimpleComment{ 197 to.Comment = &types.SimpleComment{
198 Id: v.Id, 198 Id: v.Id,
199 Content: v.Content, 199 Content: v.Content,
@@ -127,6 +127,9 @@ func (repository *ArticleCommentRepository) Find(ctx context.Context, conn trans @@ -127,6 +127,9 @@ func (repository *ArticleCommentRepository) Find(ctx context.Context, conn trans
127 if v, ok := queryOptions["topId"]; ok { 127 if v, ok := queryOptions["topId"]; ok {
128 tx = tx.Where("top_id=?", v) 128 tx = tx.Where("top_id=?", v)
129 } 129 }
  130 + if v, ok := queryOptions["ids"]; ok {
  131 + tx = tx.Where("id in (?)", v)
  132 + }
130 if v, ok := queryOptions["show"]; ok { 133 if v, ok := queryOptions["show"]; ok {
131 tx = tx.Where("show=?", v) 134 tx = tx.Where("show=?", v)
132 } 135 }