mirror of
https://github.com/PlayEdu/PlayEdu
synced 2025-12-25 04:11:41 +08:00
返回学习统计
This commit is contained in:
@@ -18,4 +18,8 @@ public interface UserLearnDurationStatsService extends IService<UserLearnDuratio
|
||||
Long yesterdayTotal();
|
||||
|
||||
List<UserLearnDurationStats> top10();
|
||||
|
||||
Integer todayUserDuration(Integer userId);
|
||||
|
||||
Integer userDuration(Integer userId);
|
||||
}
|
||||
|
||||
@@ -66,6 +66,17 @@ public class UserLearnDurationStatsServiceImpl extends ServiceImpl<UserLearnDura
|
||||
String today = simpleDateFormat.format(new Date());
|
||||
return list(query().getWrapper().eq("created_date", today).orderByDesc("duration").last("limit 10"));
|
||||
}
|
||||
|
||||
@Override
|
||||
public Integer todayUserDuration(Integer userId) {
|
||||
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
|
||||
return getBaseMapper().getUserDateDuration(userId, simpleDateFormat.format(new Date()));
|
||||
}
|
||||
|
||||
@Override
|
||||
public Integer userDuration(Integer userId) {
|
||||
return getBaseMapper().getUserDuration(userId);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user