mirror of
https://github.com/PlayEdu/PlayEdu
synced 2026-02-03 15:22:19 +08:00
返回线上课学员的学习记录最早的学习时间
This commit is contained in:
@@ -36,6 +36,7 @@ import xyz.playedu.common.types.JsonResponse;
|
||||
import xyz.playedu.common.types.mapper.UserCourseHourRecordUserFirstCreatedAtMapper;
|
||||
import xyz.playedu.common.types.paginate.PaginationResult;
|
||||
import xyz.playedu.common.types.paginate.UserPaginateFilter;
|
||||
import xyz.playedu.course.domain.UserCourseHourRecord;
|
||||
import xyz.playedu.course.domain.UserCourseRecord;
|
||||
import xyz.playedu.course.service.CourseService;
|
||||
import xyz.playedu.course.service.UserCourseHourRecordService;
|
||||
@@ -141,6 +142,14 @@ public class CourseUserController {
|
||||
userService.getDepIdsGroup(result.getData().stream().map(User::getId).toList()));
|
||||
data.put("departments", departmentService.id2name());
|
||||
|
||||
// 获取每个学员的最早学习时间
|
||||
List<UserCourseHourRecord> perUserEarliestRecords =
|
||||
userCourseHourRecordService.getCoursePerUserEarliestRecord(courseId);
|
||||
data.put(
|
||||
"per_user_earliest_records",
|
||||
perUserEarliestRecords.stream()
|
||||
.collect(Collectors.toMap(UserCourseHourRecord::getUserId, e -> e)));
|
||||
|
||||
return JsonResponse.data(data);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user