李昊 4 years ago
parent
commit
8350216a72

+ 3 - 2
gx_api/GxPress/Service/GxPress.Service.Implement/Middle/MiddleService.cs

@@ -660,8 +660,9 @@ namespace GxPress.Service.Implement.Middle
         public async Task<List<MiddleSearchFolderResult>> SearchNoteFolderAsync(MiddleSearchFolderRequest request)
         {
             var query = Q.NewQuery();
-            query.Where(nameof(Entity.Middle.Middle.ParentId), request.ParentId)
-                .Where(nameof(Entity.Middle.Middle.AttributeValue), 2)
+            if (request.ParentId >= 0)
+                query.Where(nameof(Entity.Middle.Middle.ParentId), request.ParentId);
+               query.Where(nameof(Entity.Middle.Middle.AttributeValue), 2)
                 .Where(nameof(Entity.Middle.Middle.FolderType), request.TypeId)
                 .Where(nameof(Entity.Middle.Middle.UserId), request.UserId)
                 .Where(nameof(Entity.Middle.Middle.IsDelete), false);