فهرست منبع

修改sort和分页数量

guo00guo 4 سال پیش
والد
کامیت
197bdb3f9e
1فایلهای تغییر یافته به همراه2 افزوده شده و 9 حذف شده
  1. 2 9
      site/src/main/java/com/mooctest/crowd/site/controller/TechnicalArticlesController.java

+ 2 - 9
site/src/main/java/com/mooctest/crowd/site/controller/TechnicalArticlesController.java

@@ -50,15 +50,8 @@ public class TechnicalArticlesController extends BaseSearchController{
 
     Pageable getPageable(SearchConditionVO searchConditionVO){
         int activePage = searchConditionVO.getActivePage() == 0?1:searchConditionVO.getActivePage();
-        // 是文章和专著,根据publicTime排序,每页5条
-        if(searchConditionVO.getSortType() == null || searchConditionVO.getSortType() == ""){
-            Sort sort = new Sort(Sort.Direction.DESC,"publicTime");
-            return new PageRequest(activePage-1, CommonConstant.TECHNOLOGY_ROWS_ON_PAGE, sort);
-        }else{// 是工具,根据id排序,每页10条
-            Sort sort = new Sort(Sort.Direction.DESC,searchConditionVO.getSortType());
-            return new PageRequest(activePage-1, CommonConstant.HOT_CROWD_ROWS_ON_PAGE, sort);
-        }
-
+        Sort sort = new Sort(Sort.Direction.DESC,searchConditionVO.getSortType());
+        return new PageRequest(activePage-1, CommonConstant.TECHNOLOGY_ROWS_ON_PAGE, sort);
     }
 
     Pageable getRanking(){