首页增加课件数

This commit is contained in:
wsw
2024-06-04 15:25:22 +08:00
parent 6776fecfe9
commit 5b027dfa23
3 changed files with 17 additions and 0 deletions

View File

@@ -59,4 +59,6 @@ public interface ResourceService extends IService<Resource> {
void updateNameAndCategoryId(Integer id, String name, Integer categoryId);
List<Integer> categoryIds(Integer resourceId);
Integer total(List<String> types);
}

View File

@@ -186,4 +186,9 @@ public class ResourceServiceImpl extends ServiceImpl<ResourceMapper, Resource>
.map(ResourceCategory::getCid)
.toList();
}
@Override
public Integer total(List<String> types) {
return Math.toIntExact(count(query().getWrapper().in("type", types).eq("is_hidden", 0)));
}
}