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

@ -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, @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);

View File

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

View File

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