| | |
| | | .eq(Objects.nonNull(courseDTO.getCourseType()), Course::getCourseType, courseDTO.getCourseType()) |
| | | .eq(Objects.nonNull(courseDTO.getChargeType()), Course::getChargeType, courseDTO.getChargeType()) |
| | | .eq(Objects.nonNull(courseDTO.getListingStatus()), Course::getListingStatus, courseDTO.getListingStatus()) |
| | | .orderByDesc(Course::getSortNum); |
| | | .orderByDesc(Course::getCreateTime); |
| | | if (org.springframework.util.StringUtils.hasLength(courseDTO.getCourseTitle())){ |
| | | List<Long> collect = courseService.lambdaQuery().like(Course::getCourseTitle, courseDTO.getCourseTitle()).list() |
| | | .stream().map(Course::getId).collect(Collectors.toList()); |
| | |
| | | orderCourseVO.setGeneralPrice(record.getGeneralPrice()); |
| | | orderCourseVO.setIosPrice(record.getIosPrice()); |
| | | orderCourseVO.setCoverUrl(record.getCoverUrl()); |
| | | List<AppUser> data1 = remoteAppUserService.getUserByCourseId(record.getId()).getData(); |
| | | |
| | | List<CourseChapter> list = courseChapterService.lambdaQuery().eq(CourseChapter::getCourseId, record.getId()).list(); |
| | | int temp = 0 ; |
| | | int temp1 = 0 ; |
| | | for (CourseChapter courseChapter : list) { |
| | | temp+= courseChapter.getVirtualLearnedNum(); |
| | | Long data2 = remoteAppUserService.getCourseChapterHistoryCount(courseChapter.getId()).getData(); |
| | | temp1+=data2; |
| | | } |
| | | int size = courseLearningRecordService.lambdaQuery().eq(CourseLearningRecord::getCourseId, record.getId()) |
| | | .groupBy(CourseLearningRecord::getAppUserId).list().size(); |
| | | orderCourseVO.setCount(temp+size); |
| | | orderCourseVO.setCount(temp+temp1); |
| | | orderCourseVOS.add(orderCourseVO); |
| | | } |
| | | break; |
| | |
| | | }else{ |
| | | clientCourseVO.setIsVip(0); |
| | | } |
| | | List<Long> collect9 = data.stream().map(AppUser::getId).collect(Collectors.toList()); |
| | | if (!collect9.isEmpty()){ |
| | | if (collect9.contains(userId)){ |
| | | clientCourseVO.setIsBuy(1); |
| | | } |
| | | } |
| | | if(byId.getChargeType() != 1){ |
| | | List<CourseChapter> list = courseChapterService.lambdaQuery().eq(CourseChapter::getCourseId, byId.getId()) |
| | | .list(); |
| | |
| | | // 查询推荐课程 |
| | | List<Course> list = courseService.lambdaQuery().eq(Course::getCateId, byId.getCateId()) |
| | | .eq(Course::getCourseType,1) |
| | | .eq(Course::getListingStatus,1) |
| | | .ne(Course::getId,id) |
| | | .eq(Course::getRecommend, 1).list(); |
| | | List<Course> courses = new ArrayList<>(); |
| | | // 随机获取两个课程 |
| | |
| | | int index = (int) (Math.random() * size); |
| | | if (size >= 2){ |
| | | for (int i = 0; i < 2; i++) { |
| | | courses.add(list.get(index)); |
| | | courses.add(list.get(i)); |
| | | } |
| | | }else{ |
| | | courses.add(list.get(index)); |
| | | courses.addAll(list); |
| | | } |
| | | } |
| | | for (Course cours : courses) { |
| | |
| | | // 查询推荐课程 |
| | | List<Course> list = courseService.lambdaQuery().eq(Course::getCateId, byId.getCateId()) |
| | | .eq(Course::getCourseType,1) |
| | | .eq(Course::getListingStatus,1) |
| | | .ne(Course::getId,id) |
| | | .eq(Course::getRecommend, 1).list(); |
| | | List<Course> courses = new ArrayList<>(); |
| | | // 随机获取两个课程 |
| | |
| | | Long userId = loginUser.getUserid(); |
| | | Course byId = courseService.getById(courseId); |
| | | List<Course> list = courseService.lambdaQuery().eq(Course::getCateId, byId.getCateId()) |
| | | .eq(Course::getListingStatus,1) |
| | | .ne(Course::getId,courseId) |
| | | .eq(Course::getCourseType, 1).list(); |
| | | for (Course course : list) { |