wangfei 6 年之前
父節點
當前提交
50fdeca8b8

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

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

6
   datasource:
6
   datasource:
7
     username: whole-estate
7
     username: whole-estate
8
     password: whole-estate
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
     driver-class-name: com.mysql.jdbc.Driver
10
     driver-class-name: com.mysql.jdbc.Driver
11
     initial-size: 10 # 初始化连接数
11
     initial-size: 10 # 初始化连接数
12
     max-active: 20 # 最大连接数
12
     max-active: 20 # 最大连接数