| | |
| | | { |
| | | throw Oops.Oh(EnumErrorCodeType.s400, "请填写类别Id或编号"); |
| | | } |
| | | if (request.ParentId.HasValue) |
| | | { |
| | | q = q.Where(it => it.ParentId == request.ParentId); |
| | | } |
| | | if (request.Keywords.IsNotNull()) |
| | | { |
| | | q = q.Where(it => |
| | |
| | | { |
| | | 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.MaxDeep.HasValue) |
| | | { |
| | | q = q.Where(it => it.Deep <= request.MaxDeep); |
| | | } |
| | | 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); |