wangfei 6 年前
父节点
当前提交
50fdeca8b8

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

@@ -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
             // 查询图片

+ 1
- 1
whole-estate/src/main/resources/application.yml 查看文件

@@ -6,7 +6,7 @@ spring:
6 6
   datasource:
7 7
     username: whole-estate
8 8
     password: whole-estate
9
-    url: jdbc:mysql://47.101.36.130:3306/whole-estate?useUnicode=true&characterEncoding=UTF-8&allowMultiQueries=true
9
+    url: jdbc:mysql://rm-uf6z3z6jq11x653d77o.mysql.rds.aliyuncs.com:3306/whole-estate?useUnicode=true&characterEncoding=UTF-8&allowMultiQueries=true
10 10
     driver-class-name: com.mysql.jdbc.Driver
11 11
     initial-size: 10 # 初始化连接数
12 12
     max-active: 20 # 最大连接数