Browse Source

更新文件 AppHomePageAction.java

陈士柏 2 years ago
parent
commit
63c366e537
1 changed files with 8 additions and 2 deletions
  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);