Browse Source

不限直播间,只需要连续观看

xw 3 days ago
parent
commit
d12d074150

+ 2 - 3
fs-service/src/main/java/com/fs/live/mapper/LiveCompletionPointsRecordMapper.java

@@ -29,10 +29,9 @@ public interface LiveCompletionPointsRecordMapper {
                                                      @Param("currentDate") Date currentDate);
 
     /**
-     * 查询用户最近一次完课记录
+     * 查询用户最近一次完课记录(不限直播间,用于计算连续天数)
      */
-    LiveCompletionPointsRecord selectLatestByUser(@Param("liveId") Long liveId, 
-                                                   @Param("userId") Long userId);
+    LiveCompletionPointsRecord selectLatestByUser(@Param("userId") Long userId);
 
     /**
      * 查询用户未领取的完课记录列表

+ 2 - 2
fs-service/src/main/java/com/fs/live/service/impl/LiveCompletionPointsRecordServiceImpl.java

@@ -128,8 +128,8 @@ public class LiveCompletionPointsRecordServiceImpl implements ILiveCompletionPoi
                 return;
             }
 
-            // 7. 查询最近一次完课记录,计算连续天数
-            LiveCompletionPointsRecord latestRecord = recordMapper.selectLatestByUser(liveId, userId);
+            // 7. 查询最近一次完课记录(不限直播间),计算连续天数
+            LiveCompletionPointsRecord latestRecord = recordMapper.selectLatestByUser(userId);
             int continuousDays = 1;
 
             if (latestRecord != null) {

+ 2 - 3
fs-service/src/main/resources/mapper/live/LiveCompletionPointsRecordMapper.xml

@@ -81,11 +81,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         LIMIT 1
     </select>
 
-    <!-- 查询用户最近一次完课记录 -->
+    <!-- 查询用户最近一次完课记录(不限直播间,用于计算连续天数) -->
     <select id="selectLatestByUser" resultMap="LiveCompletionPointsRecordResult">
         SELECT * FROM live_completion_points_record
-        WHERE live_id = #{liveId}
-          AND user_id = #{userId}
+        WHERE user_id = #{userId}
         ORDER BY current_completion_date DESC
         LIMIT 1
     </select>