Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Paginator.generateLinkPageNumbers计算中间页有问题 #8

Open
loocao opened this issue Apr 3, 2015 · 0 comments
Open

Paginator.generateLinkPageNumbers计算中间页有问题 #8

loocao opened this issue Apr 3, 2015 · 0 comments

Comments

@loocao
Copy link

loocao commented Apr 3, 2015

测试条件:

  • currentPageNumber=4
  • lastPageNumber=20
  • count=5

得到的结果是:[1,2,3,4,5,6],实际应该是[2,3,4,5,6]

经检查发现:

if (endPageNumber - startPageNumber < count) {
    startPageNumber = endPageNumber - count;
    if (startPageNumber <= 0) {
        startPageNumber = 1;
    }
}

if判断有问题.
startPageNumber,endPageNumber都是已经包含进了,所以相减的时候应该+1,这样才能保证中间页<count

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant