| | |
| | | { |
| | | q = q |
| | | .OrderBy(it => it.Sort).ThenBy(it => it.CreatedTime) |
| | | .Where(it => |
| | | it.ParentId == request.ParentId |
| | | && !it.IsDisabled); |
| | | .Where(it => !it.IsDisabled); |
| | | if (!request.All) |
| | | { |
| | | q = q.Where(it => it.ParentId == request.ParentId); |
| | | } |
| | | if (request.CategoryCode == "70" || request.CategoryId == new Guid("B21FE000-BB7F-4498-08E9-08DDD572EF73")) |
| | | { |
| | | q = q.Where(it => it.Deep <= 3); |
| | | } |
| | | if (request.Keywords.IsNotNull()) |
| | | { |
| | | q = q.Where(it => |
| | | it.Code.Contains(request.Keywords) |
| | | || it.Content.Contains(request.Keywords) |
| | | || it.Field1.Contains(request.Keywords) |
| | | || it.Field2.Contains(request.Keywords) |
| | | || it.Field3.Contains(request.Keywords) |
| | | || it.Field4.Contains(request.Keywords) |
| | | || it.Field5.Contains(request.Keywords)); |
| | | } |
| | | if (request.CategoryId.HasValue) |
| | | { |
| | | q = q.Where(it => it.CategoryId == request.CategoryId); |