From 8dded98f395bbcb4480146ee48a1b2f4eda9712f Mon Sep 17 00:00:00 2001 From: xing Date: Tue, 14 Feb 2023 23:44:48 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B0=8F=E8=B0=83=E6=95=B4=EF=BC=8C=E4=BF=AE?= =?UTF-8?q?=E5=A4=8D=E4=B8=80bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- internal/plugins/pagination.go | 2 +- internal/theme/common/index.go | 2 +- plugin/pagination/pagination.go | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/internal/plugins/pagination.go b/internal/plugins/pagination.go index d4e93bf..3dc95ac 100644 --- a/internal/plugins/pagination.go +++ b/internal/plugins/pagination.go @@ -29,7 +29,7 @@ var twentyFifteen = PageEle{ ้กต %d`, } -func (p PageEle) Current(page, totalPage int) string { +func (p PageEle) Current(page, totalPage, totalRow int) string { return fmt.Sprintf(p.CurrentEle, page) } diff --git a/internal/theme/common/index.go b/internal/theme/common/index.go index e10553b..43e4a47 100644 --- a/internal/theme/common/index.go +++ b/internal/theme/common/index.go @@ -33,8 +33,8 @@ func (i *IndexHandle) ParseIndex(parm *IndexParams) (err error) { i.Stats = constraints.ParamError return } - i.Param.CacheKey = i.Param.getSearchKey() i.Param.ParseParams() + i.Param.CacheKey = i.Param.getSearchKey() i.GinH["title"] = i.Param.getTitle() i.GinH["search"] = i.Param.Search i.GinH["header"] = i.Param.Header diff --git a/plugin/pagination/pagination.go b/plugin/pagination/pagination.go index 4601fed..3148f77 100644 --- a/plugin/pagination/pagination.go +++ b/plugin/pagination/pagination.go @@ -6,7 +6,7 @@ import ( ) type Elements interface { - Current(page, totalPage int) string + Current(page, totalPage, totalRows int) string Prev(url string) string Next(url string) string Dots() string @@ -67,7 +67,7 @@ func (p ParsePagination) ToHtml() (html string) { for page := start; page <= end; page++ { h := "" if p.CurrentPage == page { - h = p.Current(page, p.TotalPage) + h = p.Current(page, p.TotalPage, p.TotalRaw) } else { h = p.Middle(page, p.Url(p.Path, p.Query, page)) }