会员无法解锁短剧
This commit is contained in:
@@ -171,6 +171,13 @@ public class CourseDetailsServiceImpl extends ServiceImpl<CourseDetailsDao, Cour
|
|||||||
log.error("未找到该剧集 用户id:{} 剧集:{}", userId, courseId);
|
log.error("未找到该剧集 用户id:{} 剧集:{}", userId, courseId);
|
||||||
return Result.error("未找到该剧集");
|
return Result.error("未找到该剧集");
|
||||||
}
|
}
|
||||||
|
boolean isVip;
|
||||||
|
UserEntity userEntity = userService.selectUserById(userId);
|
||||||
|
if (userEntity.getMember() != null && userEntity.getMember() == 2) {
|
||||||
|
isVip = true;
|
||||||
|
}else{
|
||||||
|
isVip = false;
|
||||||
|
}
|
||||||
//查询用户是否购买了整集
|
//查询用户是否购买了整集
|
||||||
CourseUser courseUser = courseUserDao.selectCourseUser(courseId, userId);
|
CourseUser courseUser = courseUserDao.selectCourseUser(courseId, userId);
|
||||||
// 每天购买超过上限,获得免费时间段资格
|
// 每天购买超过上限,获得免费时间段资格
|
||||||
@@ -215,7 +222,7 @@ public class CourseDetailsServiceImpl extends ServiceImpl<CourseDetailsDao, Cour
|
|||||||
current.set(s);
|
current.set(s);
|
||||||
}
|
}
|
||||||
// 不免费 3集以后 (已买的不为空 并不在已买的包含)
|
// 不免费 3集以后 (已买的不为空 并不在已买的包含)
|
||||||
if (!freeWatch && s.getSort() > 3 && (CollectionUtil.isEmpty(finalDetailsId) || !finalDetailsId.contains(s.getCourseDetailsId())) && courseUser == null) {
|
if (!freeWatch && s.getSort() > 3 && (CollectionUtil.isEmpty(finalDetailsId) || !finalDetailsId.contains(s.getCourseDetailsId())) && courseUser == null && !isVip) {
|
||||||
s.setVideoUrl(null);
|
s.setVideoUrl(null);
|
||||||
}
|
}
|
||||||
if (s.getSort() > finalStartSort && s.getSort() < finalEndSort) {
|
if (s.getSort() > finalStartSort && s.getSort() < finalEndSort) {
|
||||||
@@ -239,7 +246,7 @@ public class CourseDetailsServiceImpl extends ServiceImpl<CourseDetailsDao, Cour
|
|||||||
map.put("list", courseDetailsSetVos);
|
map.put("list", courseDetailsSetVos);
|
||||||
return new Result().put("data", map);
|
return new Result().put("data", map);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.error("请求剧集异常打印:",e);
|
log.error("请求剧集异常打印:", e);
|
||||||
return Result.error("请求剧集失败");
|
return Result.error("请求剧集失败");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user