李昊 4 years ago
parent
commit
bdbf6c1369

+ 5 - 5
gx_api/GxPress/Service/GxPress.Service.Implement/Middle/MiddleService.cs

@@ -662,15 +662,15 @@ namespace GxPress.Service.Implement.Middle
             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);
+            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.Where(nameof(Entity.Middle.Middle.FolderName), request.KeyWord);
+                query.WhereLike(nameof(Entity.Middle.Middle.FolderName), $"%{request.KeyWord}%");
             var middles = await _middleRepository.FindAsync(query.OrderByDesc(nameof(Entity.Middle.Middle.IsSystemDefault),
                 nameof(Entity.Middle.Middle.AttributeValue), nameof(Entity.Middle.Middle.IsTop),
                 nameof(Entity.Middle.Middle.CreatedDate)));