浏览代码

bugfix:3007举报成功后的查询详情,删除的能查到

刘云鑫 2 月之前
父节点
当前提交
ddbacd6f67

+ 14 - 4
alien-store/src/main/java/shop/alien/store/service/impl/LifeUserViolationServiceImpl.java

@@ -774,7 +774,10 @@ public class LifeUserViolationServiceImpl extends ServiceImpl<LifeUserViolationM
         List<String> videoFileType = Arrays.asList("mp4", "avi", "mov", "wmv", "flv", "mkv");
 
         if ("2".equals(item.getReportContextType())) {
-            LifeUserDynamics dynamicsInfo = lifeUserDynamicsMapper.selectById(item.getDynamicsId());
+            LifeUserDynamics dynamicsInfo = lifeUserDynamicsMapper.selectOne(new LambdaQueryWrapper<LifeUserDynamics>()
+                    .eq(LifeUserDynamics::getId, item.getDynamicsId())
+                    .and(d -> d.eq(LifeUserDynamics::getDeleteFlag, 1)
+                            .or(c-> c.eq(LifeUserDynamics::getDeleteFlag, 0))));
             item.setDynamicsInfo(dynamicsInfo);
             // 将逗号分隔的图片路径拆分成 List<String>
             if (dynamicsInfo != null && StringUtils.isNotEmpty(dynamicsInfo.getImagePath())) {
@@ -788,13 +791,20 @@ public class LifeUserViolationServiceImpl extends ServiceImpl<LifeUserViolationM
 
         if ("3".equals(item.getReportContextType())) {
             // TODO: 处理评论类型
-            CommonComment commonComment = commonCommentMapper.selectById(item.getBusinessId());
+            CommonComment commonComment = commonCommentMapper.selectOne(new LambdaQueryWrapper<CommonComment>()
+                    .eq(CommonComment::getId, item.getBusinessId())
+                    .and(d -> d.eq(CommonComment::getDeleteFlag, 1)
+                            .or(c-> c.eq(CommonComment::getDeleteFlag, 0))));
+
+
             item.setCommonCommentInfo(commonComment);
 
 //            StoreComment commentInfo = storeCommentMapper.selectById(item.getBusinessId());
 //            item.setCommentInfo(commentInfo);
-
-            LifeUserDynamics dynamicsInfo = lifeUserDynamicsMapper.selectById(commonComment.getSourceId());
+            LifeUserDynamics dynamicsInfo = lifeUserDynamicsMapper.selectOne(new LambdaQueryWrapper<LifeUserDynamics>()
+                    .eq(LifeUserDynamics::getId, commonComment.getSourceId())
+                    .and(d -> d.eq(LifeUserDynamics::getDeleteFlag, 1)
+                            .or(c-> c.eq(LifeUserDynamics::getDeleteFlag, 0))));
             item.setDynamicsInfo(dynamicsInfo);
             // 将逗号分隔的图片路径拆分成 List<String>
             if (dynamicsInfo != null && StringUtils.isNotEmpty(dynamicsInfo.getImagePath())) {