소스 검색

更新文件 AppHomePageAction.java

陈士柏 2 년 전
부모
커밋
63c366e537
1개의 변경된 파일8개의 추가작업 그리고 2개의 파일을 삭제
  1. 8 2
      mhotel/src/com/happy/action/AppHomePageAction.java

+ 8 - 2
mhotel/src/com/happy/action/AppHomePageAction.java

@@ -391,8 +391,14 @@ public class AppHomePageAction extends ActionSupport implements ServletRequestAw
 
             }
         }
-
-        List<Hotel> lh = RandomSelection.getList(iPage.getPageList(), 6);
+        List<Hotel> lh = new ArrayList<>();
+        if (iPage.getPageList()!=null ){
+            if (iPage.getPageList().size()>=6){
+                lh = RandomSelection.getList(iPage.getPageList(), 6);
+            } else {
+                lh = iPage.getPageList();
+            }
+        }
         iPage.setPageList(lh);
         // 用户访问量数据
         userVisitsDao.add(userId);