Prechádzať zdrojové kódy

修改删除动态的bug

jinshihui 1 mesiac pred
rodič
commit
7e170fd314

+ 4 - 10
nightFragrance-massage/src/main/java/com/ylx/moment/service/impl/TechnicianMomentServiceImpl.java

@@ -738,16 +738,10 @@ public class TechnicianMomentServiceImpl extends ServiceImpl<TechnicianMomentMap
             throw new ServiceException("审核中的动态不支持删除");
         }
 
-        TechnicianMoment update = new TechnicianMoment();
-        update.setIsDelete(DELETED);
-        update.setUpdateBy(openId);
-        update.setUpdateTime(LocalDateTime.now());
-
-        LambdaUpdateWrapper<TechnicianMoment> updateWrapper = new LambdaUpdateWrapper<>();
-        updateWrapper.eq(TechnicianMoment::getId, momentId)
-                .eq(TechnicianMoment::getTechnicianId, technician.getId())
-                .eq(TechnicianMoment::getIsDelete, NOT_DELETED);
-        int rows = momentMapper.update(update, updateWrapper);
+
+        LambdaQueryWrapper<TechnicianMoment> queryWrapper = new LambdaQueryWrapper<>();
+        queryWrapper.eq(TechnicianMoment::getId, momentId);
+        int rows = momentMapper.delete(queryWrapper);
         if (rows <= 0) {
             throw new ServiceException("删除动态失败");
         }