瀏覽代碼

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

zjxpcyc 6 年之前
父節點
當前提交
f01302767b

+ 3
- 0
whole-estate/src/main/java/com/example/wholeestate/model/Encyclopedia.java 查看文件

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

+ 10
- 0
whole-estate/src/main/java/com/example/wholeestate/service/impl/CommentServiceImpl.java 查看文件

168
             childCommentQuery.eq("parent_id", e.getCommentId());
168
             childCommentQuery.eq("parent_id", e.getCommentId());
169
             childCommentQuery.eq("status", 1);
169
             childCommentQuery.eq("status", 1);
170
             List<Comment> comments = commentMapper.selectList(childCommentQuery);
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
             e.setChildComment(comments);
181
             e.setChildComment(comments);
172
 
182
 
173
             // 查询图片
183
             // 查询图片