|
@@ -40,7 +40,7 @@ func (l *MiniArticleCommentAtWhoLogic) MiniArticleCommentAtWho(req *types.MiniAr |
|
@@ -40,7 +40,7 @@ func (l *MiniArticleCommentAtWhoLogic) MiniArticleCommentAtWho(req *types.MiniAr |
40
|
}
|
40
|
}
|
41
|
|
41
|
|
42
|
var userList []*domain.User
|
42
|
var userList []*domain.User
|
43
|
- if len(articleInfo.WhoRead) == 0 {
|
43
|
+ if articleInfo.TargetUser == domain.ArticleTargetAll {
|
44
|
//获取所有人
|
44
|
//获取所有人
|
45
|
queryOption := domain.NewQueryOptions().WithFindOnly().MustWithKV("companyId", articleInfo.CompanyId)
|
45
|
queryOption := domain.NewQueryOptions().WithFindOnly().MustWithKV("companyId", articleInfo.CompanyId)
|
46
|
_, userList, err = l.svcCtx.UserRepository.Find(l.ctx, conn, queryOption)
|
46
|
_, userList, err = l.svcCtx.UserRepository.Find(l.ctx, conn, queryOption)
|
|
@@ -49,6 +49,7 @@ func (l *MiniArticleCommentAtWhoLogic) MiniArticleCommentAtWho(req *types.MiniAr |
|
@@ -49,6 +49,7 @@ func (l *MiniArticleCommentAtWhoLogic) MiniArticleCommentAtWho(req *types.MiniAr |
49
|
return resp, nil
|
49
|
return resp, nil
|
50
|
}
|
50
|
}
|
51
|
} else {
|
51
|
} else {
|
|
|
52
|
+ if len(articleInfo.WhoRead) > 0 {
|
52
|
queryOption := domain.NewQueryOptions().WithFindOnly().MustWithKV("ids", articleInfo.WhoRead)
|
53
|
queryOption := domain.NewQueryOptions().WithFindOnly().MustWithKV("ids", articleInfo.WhoRead)
|
53
|
_, userList, err = l.svcCtx.UserRepository.Find(l.ctx, conn, queryOption)
|
54
|
_, userList, err = l.svcCtx.UserRepository.Find(l.ctx, conn, queryOption)
|
54
|
if err != nil {
|
55
|
if err != nil {
|
|
@@ -56,13 +57,13 @@ func (l *MiniArticleCommentAtWhoLogic) MiniArticleCommentAtWho(req *types.MiniAr |
|
@@ -56,13 +57,13 @@ func (l *MiniArticleCommentAtWhoLogic) MiniArticleCommentAtWho(req *types.MiniAr |
56
|
return resp, nil
|
57
|
return resp, nil
|
57
|
}
|
58
|
}
|
58
|
}
|
59
|
}
|
59
|
-
|
60
|
+ }
|
60
|
uList := make([]types.CommentAtWho, len(userList))
|
61
|
uList := make([]types.CommentAtWho, len(userList))
|
61
|
-
|
|
|
62
|
for i := range userList {
|
62
|
for i := range userList {
|
63
|
uList[i] = types.CommentAtWho{
|
63
|
uList[i] = types.CommentAtWho{
|
64
|
Id: userList[i].Id,
|
64
|
Id: userList[i].Id,
|
65
|
Name: userList[i].Name,
|
65
|
Name: userList[i].Name,
|
|
|
66
|
+ Avatar: userList[i].Avatar,
|
66
|
FirstLetter: "",
|
67
|
FirstLetter: "",
|
67
|
}
|
68
|
}
|
68
|
for _, val := range userList[i].PinYinName {
|
69
|
for _, val := range userList[i].PinYinName {
|