mirror of
https://github.com/PlayEdu/PlayEdu
synced 2025-06-06 09:14:03 +08:00
首页增加课件数
This commit is contained in:
parent
6776fecfe9
commit
5b027dfa23
@ -82,6 +82,16 @@ public class DashboardController {
|
||||
data.put(
|
||||
"resource_image_total", resourceService.total(BackendConstant.RESOURCE_TYPE_IMAGE));
|
||||
|
||||
List<String> types = new ArrayList<>();
|
||||
types.add(BackendConstant.RESOURCE_TYPE_PDF);
|
||||
types.add(BackendConstant.RESOURCE_TYPE_WORD);
|
||||
types.add(BackendConstant.RESOURCE_TYPE_PPT);
|
||||
types.add(BackendConstant.RESOURCE_TYPE_EXCEL);
|
||||
types.add(BackendConstant.RESOURCE_TYPE_ZIP);
|
||||
types.add(BackendConstant.RESOURCE_TYPE_RAR);
|
||||
types.add(BackendConstant.RESOURCE_TYPE_TXT);
|
||||
data.put("resource_file_total", resourceService.total(types));
|
||||
|
||||
data.put("user_learn_today", userLearnDurationStatsService.todayTotal());
|
||||
data.put("user_learn_yesterday", userLearnDurationStatsService.yesterdayTotal());
|
||||
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -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)));
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user