From b768ec10bd8ed06b281908e8b5f67aefa135536e Mon Sep 17 00:00:00 2001 From: xing Date: Wed, 18 Jan 2023 23:20:49 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B0=8F=E4=BC=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- internal/actions/index.go | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/internal/actions/index.go b/internal/actions/index.go index 7cae888..d3eba9b 100644 --- a/internal/actions/index.go +++ b/internal/actions/index.go @@ -5,6 +5,7 @@ import ( "github.com/fthvgb1/wp-go/helper" cache2 "github.com/fthvgb1/wp-go/internal/pkg/cache" dao "github.com/fthvgb1/wp-go/internal/pkg/dao" + "github.com/fthvgb1/wp-go/internal/pkg/logs" "github.com/fthvgb1/wp-go/internal/pkg/models" "github.com/fthvgb1/wp-go/internal/plugins" "github.com/fthvgb1/wp-go/internal/theme" @@ -221,8 +222,10 @@ func Index(c *gin.Context) { postIds, totalRaw, err = cache2.PostLists(c, h.getSearchKey(), c, h.where, h.page, h.pageSize, model.SqlBuilder{{h.orderBy, h.order}}, h.join, h.postType, h.status) } if err != nil { + logs.ErrPrintln(err, "获取数据错误") return } + if len(postIds) < 1 && h.category != "" { h.titleL = "未找到页面" h.scene = plugins.Empty404 @@ -254,11 +257,6 @@ func Index(c *gin.Context) { ginH["pagination"] = pagination.NewParsePagination(totalRaw, h.pageSize, h.page, q, c.Request.URL.Path, h.paginationStep) } -type PaginationElements struct { - Prev string - Next string -} - func getTemplateName() string { tmlp := wpconfig.Options.Value("template") if i, err := theme.IsTemplateIsExist(tmlp); err != nil || !i {