Przeglądaj źródła

红德堂-V1.2 参与记录增加排序

Long 22 godzin temu
rodzic
commit
f322760c96

+ 3 - 1
fs-company-app/src/main/java/com/fs/app/controller/FsUserCourseVideoController.java

@@ -140,13 +140,15 @@ public class FsUserCourseVideoController extends AppBaseController {
                                                       @RequestParam(required = false) Long periodId,
                                                       @RequestParam(required = false) String keyword,
                                                       @RequestParam(required = false, defaultValue = "1") Integer pageNum,
-                                                      @RequestParam(required = false, defaultValue = "10") Integer pageSize) {
+                                                      @RequestParam(required = false, defaultValue = "10") Integer pageSize,
+                                                      @RequestParam(required = false, defaultValue = "true") boolean asc) {
         log.debug("参与记录 videoId:{}, type:{}, keyword: {}, pageNum: {}, pageSize: {}", videoId, type, keyword, pageNum, pageSize);
         Map<String, Object> params = new HashMap<>();
         params.put("videoId", videoId);
         params.put("periodId", periodId);
         params.put("type", type);
         params.put("keyword", keyword);
+        params.put("asc", asc);
 
         // type 0 答题领奖记录----答题正确并且领取红包的
         // type 1 完播----这堂课看完的人

+ 1 - 1
fs-service/src/main/java/com/fs/course/service/impl/FsUserCourseServiceImpl.java

@@ -188,7 +188,7 @@ public class FsUserCourseServiceImpl implements IFsUserCourseService
     @Override
     public int updateFsUserCourse(FsUserCourse fsUserCourse)
     {
-        if (fsUserCourse.getIsPrivate()==1) {
+        if (fsUserCourse.getIsPrivate() != null && fsUserCourse.getIsPrivate()==1) {
             asyncUploadQwCourseImageService.uploadQwCourseImage(fsUserCourse);
         }
 

+ 4 - 0
fs-service/src/main/resources/mapper/course/FsUserCourseMapper.xml

@@ -152,6 +152,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             </when>
         </choose>
         group by fu.user_id, fucv.video_id, fu.nick_name, fu.username, fu.avatar, fu.phone, fu.create_time
+        <choose>
+            <when test="params.asc">order by watchDate</when>
+            <otherwise>order by watchDate desc</otherwise>
+        </choose>
     </select>
 
     <select id="selectTodayCourseWatchLogCountByUserIdAndProjectId" resultType="java.lang.Integer">