李昊 4 年之前
父节点
当前提交
8eb4b212dc
共有 1 个文件被更改,包括 3 次插入1 次删除
  1. 3 1
      gx_api/GxPress/Service/GxPress.Service.Implement/Middle/MiddleService.cs

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

@@ -543,7 +543,9 @@ namespace GxPress.Service.Implement.Middle
             else
                 query.Where(nameof(Entity.Middle.Middle.FolderType), request.TypeId);
             query.Where(nameof(Entity.Middle.Middle.UserId), request.UserId)
-            .Where(nameof(Entity.Middle.Middle.IsDelete), false).WhereNotIn(nameof(Entity.Middle.Middle.Id), request.FolderIds);
+            .Where(nameof(Entity.Middle.Middle.IsDelete), false);
+            if (request.FolderIds != null && request.FolderIds.Count > 0)
+                query.WhereNotIn(nameof(Entity.Middle.Middle.Id), request.FolderIds);
             if (!string.IsNullOrWhiteSpace(request.KeyWord))
                 query.WhereLike(nameof(Entity.Middle.Middle.FolderName), $"%{request.KeyWord}%");
             if (request.TypeId == -AllTypeConst.Note.GetHashCode())