整部剧的价

This commit is contained in:
wangw 2025-01-06 18:05:55 +08:00
parent 9028b3ee46
commit 707d6fdae0
4 changed files with 5 additions and 6 deletions

View File

@ -23,7 +23,7 @@ public interface CourseDetailsDao extends BaseMapper<CourseDetails> {
* @param wholesalePrice 10集价格
*/
@Cacheable(cacheNames = "courseSets", key = "#courseId")
List<CourseDetailsSetVo> courseSets(@Param("courseId") Long courseId, Integer isPrice, BigDecimal price, BigDecimal wholesalePrice);
List<CourseDetailsSetVo> courseSets(@Param("courseId") Long courseId, Integer isPrice, BigDecimal wholesalePrice);
List<CourseDetails> findByCourseId(@Param("id") Long id, @Param("userId") Long userId);

View File

@ -178,9 +178,9 @@ public class CourseDetailsServiceImpl extends ServiceImpl<CourseDetailsDao, Cour
}
List<CourseDetailsSetVo> courseDetailsSetVos;
if (freeWatch || courseUser != null) {
courseDetailsSetVos = baseMapper.courseSets(courseId, 2, null, null);
courseDetailsSetVos = baseMapper.courseSets(courseId, 2, null);
} else {
courseDetailsSetVos = baseMapper.courseSets(courseId, 1, bean.getPrice(), bean.getWholesalePrice());
courseDetailsSetVos = baseMapper.courseSets(courseId, 1, bean.getWholesalePrice());
}
if (sort != null && sort > 2) {
startSort = sort - 3;
@ -224,6 +224,7 @@ public class CourseDetailsServiceImpl extends ServiceImpl<CourseDetailsDao, Cour
});
Map<String, Object> map = new HashMap<>();
map.put("current", current.get());
map.put("price", freeWatch ? 0 : bean.getPrice());
map.put("title", bean.getTitle());
map.put("collect", collect == null || collect.equals(0) ? 0L : 1L);
map.put("list", courseDetailsSetVos);

View File

@ -17,7 +17,6 @@ public class CourseDetailsSetVo {
private Integer isPrice;
private BigDecimal price;
private BigDecimal wholesalePrice;
private BigDecimal countPrice;
private Integer sort;
/**

View File

@ -7,9 +7,8 @@
, c.course_details_id as courseDetailsId
, c.course_details_name as courseDetailsName
, c.video_url as videoUrl
, c.price as countPrice
, c.price as price
, c.sort as sort
, ifnull(#{price}, 0) as price
, ifnull(#{wholesalePrice}, 0) as wholesalePrice
, IF(#{isPrice} = 1, c.is_price, 2) AS isPrice
, c.title_img as titleImg