diff --git a/src/main/java/com/subsidy/mapper/VodPlayHistoryMapper.java b/src/main/java/com/subsidy/mapper/VodPlayHistoryMapper.java index 0b3b996..c891a88 100644 --- a/src/main/java/com/subsidy/mapper/VodPlayHistoryMapper.java +++ b/src/main/java/com/subsidy/mapper/VodPlayHistoryMapper.java @@ -60,7 +60,7 @@ public interface VodPlayHistoryMapper extends BaseMapper { /** * 查看这个课程某个成员看的视频课程 */ - ContentVodNewVO memberRecentPlay(Long classId, Long memberId); + List memberRecentPlay(Long classId, Long memberId); /** * 查看某个成员某个课程的学习日志 diff --git a/src/main/java/com/subsidy/service/impl/MemberServiceImpl.java b/src/main/java/com/subsidy/service/impl/MemberServiceImpl.java index e00dcbb..73c34cd 100644 --- a/src/main/java/com/subsidy/service/impl/MemberServiceImpl.java +++ b/src/main/java/com/subsidy/service/impl/MemberServiceImpl.java @@ -462,9 +462,11 @@ public class MemberServiceImpl extends ServiceImpl imple contentVodNewVO.setContentVodVOS(contentVodVOS); //最新的视频记录 - ContentVodNewVO contentVodNewVO1 = vodPlayHistoryMapper.memberRecentPlay(contentVodDTO.getClassId(), contentVodDTO.getMemberId()); - contentVodNewVO.setId(contentVodNewVO1.getId()); - contentVodNewVO.setPlayRecord(contentVodNewVO.getPlayRecord()); + List contentVodNewVOS = vodPlayHistoryMapper.memberRecentPlay(contentVodDTO.getClassId(), contentVodDTO.getMemberId()); + if (contentVodNewVOS.size()>0){ + contentVodNewVO.setId(contentVodNewVOS.get(0).getId()); + contentVodNewVO.setPlayRecord(contentVodNewVOS.get(0).getPlayRecord()); + } return contentVodNewVO; } diff --git a/src/main/resources/mapper/CourseContentMapper.xml b/src/main/resources/mapper/CourseContentMapper.xml index fbfb0d5..dceb6f7 100644 --- a/src/main/resources/mapper/CourseContentMapper.xml +++ b/src/main/resources/mapper/CourseContentMapper.xml @@ -105,7 +105,8 @@ AND t.create_date = t2.create_date ) t4 ON t2.vod_id = t4.vod_id WHERE - t.content_id = #{contentId} + t.delete_date is null + and t.content_id = #{contentId} ) t3 ORDER BY t3.order_no