|
@@ -3117,8 +3117,16 @@ public class PracticeGroupServiceImpl extends BaseServiceImpl<Long, PracticeGrou
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public List<PracticeCourseDto> findUserHistoryBuyPracticeGroups(Integer userId) {
|
|
|
- List<PracticeCourseDto> userPracticeGroups = practiceGroupDao.findUserBuyPracticeGroups(userId);
|
|
|
+ public List<PracticeCourseDto> findUserHistoryBuyPracticeGroups(Integer userId, Long groupId) {
|
|
|
+ List<PracticeCourseDto> userPracticeGroups;
|
|
|
+ if(Objects.nonNull(groupId)){
|
|
|
+ PracticeGroup practiceGroup = practiceGroupDao.get(groupId);
|
|
|
+ Date date = DateUtil.addSeconds(practiceGroup.getCoursesExpireDate(), 1);
|
|
|
+ userPracticeGroups=practiceGroupDao.findUserBuyPracticeGroupsWithDate(userId,date);
|
|
|
+ }else{
|
|
|
+ userPracticeGroups = practiceGroupDao.findUserBuyPracticeGroups(userId);
|
|
|
+ }
|
|
|
+
|
|
|
if(CollectionUtils.isEmpty(userPracticeGroups)){
|
|
|
return new ArrayList<>();
|
|
|
}
|