|
@@ -61,11 +61,11 @@ public class AppHomeServiceImpl implements IAppHomeService {
|
|
|
|
|
|
// 精品课程(最多3个)
|
|
|
List<AppCourses> appCoursesFine = appCoursesMapper.selectList(Wrappers.<AppCourses>lambdaQuery()
|
|
|
- .eq(AppCourses::getPriceType, 0).eq(AppCourses::getRackingStatus,0).last("LIMIT 3"));
|
|
|
+ .eq(AppCourses::getPriceType, 0).eq(AppCourses::getRackingStatus,0).gt(AppCourses::getEndTime, new Date()).last("LIMIT 3"));
|
|
|
|
|
|
// 免费课程(最多3个)
|
|
|
List<AppCourses> appCoursesFree = appCoursesMapper.selectList(Wrappers.<AppCourses>lambdaQuery()
|
|
|
- .eq(AppCourses::getPriceType, 1).eq(AppCourses::getRackingStatus,0).last("LIMIT 3"));
|
|
|
+ .eq(AppCourses::getPriceType, 1).eq(AppCourses::getRackingStatus,0).gt(AppCourses::getEndTime, new Date()).last("LIMIT 3"));
|
|
|
|
|
|
// 合并课程信息
|
|
|
List<CourseVO> courseVO = new ArrayList<>();
|
|
@@ -112,7 +112,7 @@ public class AppHomeServiceImpl implements IAppHomeService {
|
|
|
}
|
|
|
// 获取该教练的课程(最多取2个)
|
|
|
List<AppCourses> courses = appCoursesMapper.selectList(
|
|
|
- Wrappers.<AppCourses>lambdaQuery().eq(AppCourses::getUserId, userId).eq(AppCourses::getRackingStatus,0).last("LIMIT 2"));
|
|
|
+ Wrappers.<AppCourses>lambdaQuery().eq(AppCourses::getUserId, userId).eq(AppCourses::getRackingStatus,0).gt(AppCourses::getEndTime, new Date()).last("LIMIT 2"));
|
|
|
List<InstructorVO.CourseInfoVO> courseInfoVOS = courses.stream()
|
|
|
.map(course -> {
|
|
|
InstructorVO.CourseInfoVO vo = new InstructorVO.CourseInfoVO();
|