lihao 4 년 전
부모
커밋
8cbcb54b39
1개의 변경된 파일6개의 추가작업 그리고 2개의 파일을 삭제
  1. 6 2
      gx_api/GxPress/Service/GxPress.Service.Implement/Note/NoteService.cs

+ 6 - 2
gx_api/GxPress/Service/GxPress.Service.Implement/Note/NoteService.cs

@@ -620,7 +620,7 @@ namespace GxPress.Service.Implement.Note
                     FolderId = note.FolderId,
                     MiddleId = note.Id,
                     FolderType = note.IsTopic ? AllTypeConst.TopicNote.GetHashCode() : AllTypeConst.Note.GetHashCode(),
-                    UserId = note.UserId,
+                    UserId = entity.UserId,
                     MiddleSonId = 0,
                     AttributeValue = 1,
                     IsAdmin = true
@@ -650,7 +650,11 @@ namespace GxPress.Service.Implement.Note
                     note.IsDelete = true;
                     await _noteRepository.DeleteAsync(id);
                     //获取middle修改middle
-                    var middle = await _middleRepository.GetMiddleAsync(Q.Where(nameof(Entity.Middle.Middle.MiddleId), id).Where(nameof(Entity.Middle.Middle.UserId), userId));
+                    var query = Q.NewQuery();
+                    query.Where(nameof(Entity.Middle.Middle.MiddleId), id);
+                    query.Where(nameof(Entity.Middle.Middle.UserId), userId);
+                    query.Where(nameof(Entity.Middle.Middle.FolderType), note.IsTopic ? AllTypeConst.TopicNote.GetHashCode() : AllTypeConst.Note.GetHashCode());
+                    var middle = await _middleRepository.GetMiddleAsync(query);
                     await _middleRepository.DeleteAsync(Q.Where(nameof(Entity.Middle.Middle.Id), middle.Id));
                     transactionScope.Complete();
                 }