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

分页时计算总页面不准确 #14

Open
ahchlyx opened this issue Mar 2, 2021 · 0 comments
Open

分页时计算总页面不准确 #14

ahchlyx opened this issue Mar 2, 2021 · 0 comments

Comments

@ahchlyx
Copy link

ahchlyx commented Mar 2, 2021

Page 分页查询查询方法,求总页数时好像没有考虑到记录数“刚好1页”和“多出1页,不足2页”的情况。
应该将:form.TotalPage = num / form.Rows
优化成:
if (num % form.Rows) != 0 {
form.TotalPage = (num / form.Rows) + 1
} else {
form.TotalPage = num / form.Rows
}

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