李昊 4 年之前
父節點
當前提交
c7be3dabad
共有 1 個文件被更改,包括 2 次插入16 次删除
  1. 2 16
      gx_api/GxPress/Service/GxPress.Service.Implement/Middle/MiddleService.cs

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

@@ -844,20 +844,6 @@ namespace GxPress.Service.Implement.Middle
             var database = new Database(DatabaseType.MySql, ConfigHelper.GetValue("Database:ConnectionString"));
             var connection = database.GetConnection();
             var middles = await connection.QueryAsync<Entity.Middle.Middle>(sql);
-            // var query = Q.NewQuery();
-            // 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);
-            // if (request.FolderIds.Count > 0)
-            //     query.WhereNotIn(nameof(Entity.Middle.Middle.Id), request.FolderIds);
-            // query.WhereIn(nameof(Entity.Middle.Middle.RoleId), new List<int>() { 1, 3 });
-            // if (!string.IsNullOrWhiteSpace(request.KeyWord))
-            //     query.WhereLike(nameof(Entity.Middle.Middle.FolderName), $"%{request.KeyWord}%");
-            // var orderByDesc = new string[] { nameof(Entity.Middle.Middle.IsSystemDefault), nameof(Entity.Middle.Middle.AttributeValue), nameof(Entity.Middle.Middle.IsTop), nameof(Entity.Middle.Middle.Sort) };
-            // var middles = await _middleRepository.FindAsync(query.OrderByDesc(orderByDesc));
             List<MiddleSearchFolderResult> result = new List<MiddleSearchFolderResult>();
             foreach (var item in middles)
             {
@@ -869,7 +855,7 @@ namespace GxPress.Service.Implement.Middle
                     RoleId = item.RoleId,
                     IsFolder = await _middleRepository.IsFolderAsync(item.Id),
                     IsTop = item.IsTop,
-                    FileCount = await _middleRepository.CountAsync(Q.Where(nameof(Entity.Middle.Middle.ParentId), item.Id).Where(nameof(Entity.Middle.Middle.IsDelete), false)),
+                    FileCount = await _middleRepository.CountAsync(Q.Where(nameof(Entity.Middle.Middle.ParentId), item.Id).Where(nameof(Entity.Middle.Middle.IsDelete), false).Where(nameof(Entity.Middle.Middle.FolderType), request.TypeId)),
                     IsSystemDefault = item.IsSystemDefault
                 };
                 if (item.RoleId == 3)
@@ -918,7 +904,7 @@ namespace GxPress.Service.Implement.Middle
                 }
             }
             List<MiddleSearchFolderResult> result = new List<MiddleSearchFolderResult>();
-            
+
             foreach (var item in middles)
             {
                 MiddleSearchFolderResult middleSearchFolderResult = new MiddleSearchFolderResult