|
@@ -246,13 +246,20 @@ public class CommunityArticleServiceImpl extends ServiceImpl<CommunityArticleMap
|
|
|
articleVo.setCollectionVo(communityCollectionMapper.selectCollectById(userId, articleVo.getId()));
|
|
|
|
|
|
//设置中奖信息
|
|
|
- articleVo.setCommentRaffleVo(communityCommentRaffleMapper.selectOne(
|
|
|
+ CommunityCommentRaffleVo communityCommentRaffleVo = new CommunityCommentRaffleVo();
|
|
|
+ CommunityCommentRaffle communityCommentRaffle = communityCommentRaffleMapper.selectOne(
|
|
|
new QueryWrapper<CommunityCommentRaffle>()
|
|
|
.eq("article_id", articleVo.getId())
|
|
|
.and((wrapper) -> {
|
|
|
wrapper.ne("is_delete", true).or().isNull("is_delete");
|
|
|
- })));
|
|
|
-
|
|
|
+ }));
|
|
|
+ if (communityCommentRaffle != null) {
|
|
|
+ BeanUtils.copyProperties(communityCommentRaffle, communityCommentRaffleVo);
|
|
|
+ CommunityUserInfoVo communityUserInfoVo = communityArticleService.selectCommunityUserInfoById(communityCommentRaffle.getUserId());
|
|
|
+ communityCommentRaffleVo.setUserName(communityUserInfoVo.getNickName());
|
|
|
+ communityCommentRaffleVo.setUserAvatar(communityUserInfoVo.getAvatar());
|
|
|
+ articleVo.setCommentRaffleVo(communityCommentRaffleVo);
|
|
|
+ }
|
|
|
//文章下的评论
|
|
|
// List<Map<String, Object>> comments = articleVo.getComments();
|
|
|
// for (Map<String, Object> communityArticleCommentVo : comments) {
|