资源分类过滤

This commit is contained in:
none
2023-03-08 19:14:56 +08:00
parent 64309a078a
commit db1f6fc9c6
6 changed files with 31 additions and 11 deletions

View File

@@ -54,7 +54,13 @@ public class ResourceServiceImpl extends ServiceImpl<ResourceMapper, Resource> i
wrapper.eq("type", filter.getType());
}
if (filter.getCategoryIds() != null && filter.getCategoryIds().length > 0) {
// todo 资源分类过滤
List<Integer> ridArray = relationService.getRidsByCids(Arrays.asList(filter.getCategoryIds()));
if (ridArray == null || ridArray.size() == 0) {
ridArray = new ArrayList<>() {{
add(0);
}};
}
wrapper.in("id", ridArray);
}
String sortFiled = filter.getSortField();