|  | @@ -265,7 +265,8 @@
 | 
											
												
													
														|  |          fcpd.id,
 |  |          fcpd.id,
 | 
											
												
													
														|  |          if(ccut.start_date_time is null, fcpd.start_date_time, ccut.start_date_time) as startDateTime,
 |  |          if(ccut.start_date_time is null, fcpd.start_date_time, ccut.start_date_time) as startDateTime,
 | 
											
												
													
														|  |          if(ccut.end_date_time is null, fcpd.end_date_time, ccut.end_date_time) as endDateTime,
 |  |          if(ccut.end_date_time is null, fcpd.end_date_time, ccut.end_date_time) as endDateTime,
 | 
											
												
													
														|  | -        course.project as projectId
 |  | 
 | 
											
												
													
														|  | 
 |  | +        course.project as projectId,
 | 
											
												
													
														|  | 
 |  | +        fcp.max_view_num as maxViewNum
 | 
											
												
													
														|  |          FROM `fs_user_course_video` video
 |  |          FROM `fs_user_course_video` video
 | 
											
												
													
														|  |          left join fs_user_course_period_days fcpd on fcpd.video_id = video.video_id
 |  |          left join fs_user_course_period_days fcpd on fcpd.video_id = video.video_id
 | 
											
												
													
														|  |          left join fs_user_course_period fcp on fcp.period_id = fcpd.period_id
 |  |          left join fs_user_course_period fcp on fcp.period_id = fcpd.period_id
 | 
											
										
											
												
													
														|  | @@ -282,6 +283,8 @@
 | 
											
												
													
														|  |          <if test="keyword != null and keyword !='' ">
 |  |          <if test="keyword != null and keyword !='' ">
 | 
											
												
													
														|  |              AND video.title LIKE concat('%',#{keyword},'%')
 |  |              AND video.title LIKE concat('%',#{keyword},'%')
 | 
											
												
													
														|  |          </if>
 |  |          </if>
 | 
											
												
													
														|  | 
 |  | +        <!-- 营销提前查看天数逻辑 -->
 | 
											
												
													
														|  | 
 |  | +        AND DATE_SUB(fcpd.day_date, INTERVAL fcp.max_view_num DAY) <= now()
 | 
											
												
													
														|  |          order by video.course_sort
 |  |          order by video.course_sort
 | 
											
												
													
														|  |      </select>
 |  |      </select>
 | 
											
												
													
														|  |  
 |  |  
 | 
											
										
											
												
													
														|  | @@ -335,6 +338,9 @@
 | 
											
												
													
														|  |          <if test="params.dayDate != null">
 |  |          <if test="params.dayDate != null">
 | 
											
												
													
														|  |              and fcpd.day_date = #{params.dayDate}
 |  |              and fcpd.day_date = #{params.dayDate}
 | 
											
												
													
														|  |          </if>
 |  |          </if>
 | 
											
												
													
														|  | 
 |  | +        <if test="params.keyword != null and params.keyword !='' ">
 | 
											
												
													
														|  | 
 |  | +            AND video.title LIKE concat('%',#{params.keyword},'%')
 | 
											
												
													
														|  | 
 |  | +        </if>
 | 
											
												
													
														|  |          and (
 |  |          and (
 | 
											
												
													
														|  |          (fcpd.start_date_time <=  CONCAT( CURDATE(), ' 23:59:59' ) and fcpd.end_date_time >= CONCAT( CURDATE(), ' 00:00:00' ))
 |  |          (fcpd.start_date_time <=  CONCAT( CURDATE(), ' 23:59:59' ) and fcpd.end_date_time >= CONCAT( CURDATE(), ' 00:00:00' ))
 | 
											
												
													
														|  |          or (ccut.start_date_time <=  CONCAT( CURDATE(), ' 23:59:59' ) and ccut.end_date_time >= CONCAT( CURDATE(), ' 00:00:00' ))
 |  |          or (ccut.start_date_time <=  CONCAT( CURDATE(), ' 23:59:59' ) and ccut.end_date_time >= CONCAT( CURDATE(), ' 00:00:00' ))
 |