From e5f68db556030332682a4ffa98e84e822694a4fd Mon Sep 17 00:00:00 2001 From: liangshiwei Date: Thu, 14 May 2020 18:44:37 +0800 Subject: [PATCH] Fix PageModel.cs --- .../TagHelpers/Pagination/PagerModel.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Pagination/PagerModel.cs b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Pagination/PagerModel.cs index db74266f38..980aacee8a 100644 --- a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Pagination/PagerModel.cs +++ b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Pagination/PagerModel.cs @@ -54,8 +54,8 @@ namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Pagination CurrentPage = currentPage; } - ShowingFrom = totalCount == 0 ? 0 : CurrentPage * PageSize; - ShowingTo = totalCount == 0 ? 0 : ShowingFrom + PageSize; + ShowingFrom = totalCount == 0 ? 0 : (CurrentPage - 1) * PageSize + 1; + ShowingTo = totalCount == 0 ? 0 : (int)Math.Min(ShowingFrom + PageSize - 1 , totalCount); PreviousPage = CurrentPage <= 1 ? 1 : CurrentPage - 1; NextPage = CurrentPage >= TotalPageCount ? CurrentPage : CurrentPage + 1; Pages = CalculatePageNumbers();