Skip to content

Commit

Permalink
分页取数据时,如果数据一条都没有返回, pageInfo.isIsLastPage(); 返回false #50
Browse files Browse the repository at this point in the history
  • Loading branch information
abel533 committed May 10, 2017
1 parent 084e725 commit 7a4c6eb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/main/java/com/github/pagehelper/PageInfo.java
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ public PageInfo(List<T> list, int navigatePages) {
this.pageNum = 1;
this.pageSize = list.size();

this.pages = 1;
this.pages = this.pageSize > 0 ? 1 : 0;
this.list = list;
this.size = list.size();
this.total = list.size();
Expand Down Expand Up @@ -200,7 +200,7 @@ private void calcPage() {
*/
private void judgePageBoudary() {
isFirstPage = pageNum == 1;
isLastPage = pageNum == pages;
isLastPage = pageNum == pages || pages == 0;;
hasPreviousPage = pageNum > 1;
hasNextPage = pageNum < pages;
}
Expand Down

0 comments on commit 7a4c6eb

Please sign in to comment.