Parcourir la source

Merge branch 'master' of http://git.ycjcjy.com/whole-estate/service

zjxpcyc il y a 6 ans
Parent
révision
f01302767b

+ 3
- 0
whole-estate/src/main/java/com/example/wholeestate/model/Encyclopedia.java Voir le fichier

@@ -1,5 +1,6 @@
1 1
 package com.example.wholeestate.model;
2 2
 
3
+import com.baomidou.mybatisplus.annotation.TableField;
3 4
 import com.baomidou.mybatisplus.annotation.TableName;
4 5
 import lombok.Data;
5 6
 import lombok.EqualsAndHashCode;
@@ -28,6 +29,7 @@ public class Encyclopedia implements Serializable {
28 29
 
29 30
     private String title;
30 31
 
32
+    @TableField("`desc`")
31 33
     private String desc;
32 34
 
33 35
     private String imgUrl;
@@ -40,6 +42,7 @@ public class Encyclopedia implements Serializable {
40 42
 
41 43
     private String content;
42 44
 
45
+    @TableField("`status`")
43 46
     private Integer status;
44 47
 
45 48
     private LocalDateTime createDate;

+ 10
- 0
whole-estate/src/main/java/com/example/wholeestate/service/impl/CommentServiceImpl.java Voir le fichier

@@ -168,6 +168,16 @@ public class CommentServiceImpl extends ServiceImpl<CommentMapper, Comment> impl
168 168
             childCommentQuery.eq("parent_id", e.getCommentId());
169 169
             childCommentQuery.eq("status", 1);
170 170
             List<Comment> comments = commentMapper.selectList(childCommentQuery);
171
+
172
+            comments.forEach(x -> {
173
+                    // 查询图片
174
+                QueryWrapper<CommentImg> queryPImgWrapper = new QueryWrapper<>();
175
+                queryPImgWrapper.eq("comment_id", e.getCommentId());
176
+                queryPImgWrapper.eq("status", 1);
177
+                queryPImgWrapper.orderByAsc("order_no");
178
+                List<CommentImg> commentFImgs = commentImgMapper.selectList(queryPImgWrapper);
179
+                x.setCommentImgList(commentFImgs);
180
+            });
171 181
             e.setChildComment(comments);
172 182
 
173 183
             // 查询图片