This commit is contained in:
哇塞大嘴好帥 2024-06-07 09:05:32 +08:00 committed by GitHub
commit 933fa89003
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 4 deletions

View File

@ -82,10 +82,8 @@ public class PageInfo<T> {
if (pageSize == null || pageSize == 0) {
pageSize = 10;
}
this.totalPage =
(this.total % this.pageSize) == 0
? ((this.total / this.pageSize) == 0 ? 1 : (this.total / this.pageSize))
: (this.total / this.pageSize + 1);
this.totalPage = (int) Math.ceil((double) this.total / (double) this.pageSize);
return this.totalPage;
}
}