Merge remote-tracking branch 'origin/test' into test

This commit is contained in:
张松 2025-01-06 14:40:44 +08:00
commit cdb007c4b5
3 changed files with 6 additions and 6 deletions

View File

@ -22,8 +22,8 @@ public interface CourseDetailsDao extends BaseMapper<CourseDetails> {
* @param price 全剧价格 * @param price 全剧价格
* @param wholesalePrice 10集价格 * @param wholesalePrice 10集价格
*/ */
@Cacheable(cacheNames = "courseSets" ,key = "#courseId") @Cacheable(cacheNames = "courseSets", key = "#courseId")
List<CourseDetailsSetVo> courseSets(@Param("courseId") Long courseId, @Param("collect") Long collect, Integer isPrice, BigDecimal price, BigDecimal wholesalePrice); List<CourseDetailsSetVo> courseSets(@Param("courseId") Long courseId, Integer isPrice, BigDecimal price, BigDecimal wholesalePrice);
List<CourseDetails> findByCourseId(@Param("id") Long id, @Param("userId") Long userId); List<CourseDetails> findByCourseId(@Param("id") Long id, @Param("userId") Long userId);
@ -41,7 +41,7 @@ public interface CourseDetailsDao extends BaseMapper<CourseDetails> {
*/ */
Map<String, Object> countCourse(Long courseId); Map<String, Object> countCourse(Long courseId);
@Cacheable(cacheNames = "courseCount" ,key = "#courseId") @Cacheable(cacheNames = "courseCount", key = "#courseId")
Integer countCourseByCourseId(Long courseId); Integer countCourseByCourseId(Long courseId);
List<CourseDetails> countByCourseId(); List<CourseDetails> countByCourseId();

View File

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

View File

@ -15,7 +15,6 @@
, c.title_img as titleImg , c.title_img as titleImg
, c.good_num as goodNum , c.good_num as goodNum
, c.sort as sort , c.sort as sort
, IF(#{collect} = 1, 1, 0) AS isCollect
from course_details c from course_details c
where c.course_id = #{courseId} where c.course_id = #{courseId}
order by c.sort asc order by c.sort asc