后台新增学员的最近一个月的学习统计api

This commit is contained in:
none
2023-04-18 15:49:39 +08:00
parent 3e36fcd1f0
commit b34c744da9
5 changed files with 80 additions and 35 deletions

View File

@@ -38,4 +38,6 @@ public interface UserLearnDurationStatsService extends IService<UserLearnDuratio
Long todayUserDuration(Integer userId);
Long userDuration(Integer userId);
List<UserLearnDurationStats> dateBetween(Integer userId, String startAt, String endAt);
}

View File

@@ -109,4 +109,10 @@ public class UserLearnDurationStatsServiceImpl
Long totalDuration = getBaseMapper().getUserDuration(userId);
return totalDuration == null ? 0L : totalDuration;
}
@Override
public List<UserLearnDurationStats> dateBetween(Integer userId, String startAt, String endAt) {
return list(
query().getWrapper().eq("user_id", userId).between("created_date", startAt, endAt));
}
}