小调整,修复一bug

This commit is contained in:
xing 2023-02-14 23:44:48 +08:00
parent 72a37d3bc8
commit 8dded98f39
3 changed files with 4 additions and 4 deletions

View File

@ -29,7 +29,7 @@ var twentyFifteen = PageEle{
<span class="meta-nav screen-reader-text"> </span>%d</span>`, <span class="meta-nav screen-reader-text"> </span>%d</span>`,
} }
func (p PageEle) Current(page, totalPage int) string { func (p PageEle) Current(page, totalPage, totalRow int) string {
return fmt.Sprintf(p.CurrentEle, page) return fmt.Sprintf(p.CurrentEle, page)
} }

View File

@ -33,8 +33,8 @@ func (i *IndexHandle) ParseIndex(parm *IndexParams) (err error) {
i.Stats = constraints.ParamError i.Stats = constraints.ParamError
return return
} }
i.Param.CacheKey = i.Param.getSearchKey()
i.Param.ParseParams() i.Param.ParseParams()
i.Param.CacheKey = i.Param.getSearchKey()
i.GinH["title"] = i.Param.getTitle() i.GinH["title"] = i.Param.getTitle()
i.GinH["search"] = i.Param.Search i.GinH["search"] = i.Param.Search
i.GinH["header"] = i.Param.Header i.GinH["header"] = i.Param.Header

View File

@ -6,7 +6,7 @@ import (
) )
type Elements interface { type Elements interface {
Current(page, totalPage int) string Current(page, totalPage, totalRows int) string
Prev(url string) string Prev(url string) string
Next(url string) string Next(url string) string
Dots() string Dots() string
@ -67,7 +67,7 @@ func (p ParsePagination) ToHtml() (html string) {
for page := start; page <= end; page++ { for page := start; page <= end; page++ {
h := "" h := ""
if p.CurrentPage == page { if p.CurrentPage == page {
h = p.Current(page, p.TotalPage) h = p.Current(page, p.TotalPage, p.TotalRaw)
} else { } else {
h = p.Middle(page, p.Url(p.Path, p.Query, page)) h = p.Middle(page, p.Url(p.Path, p.Query, page))
} }