From 53369f7add0bd5bf1941fc3979022e3da1118d5b Mon Sep 17 00:00:00 2001 From: xing Date: Mon, 19 Sep 2022 20:24:14 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E5=96=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- actions/common/common.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/actions/common/common.go b/actions/common/common.go index 57d3bae..c7bccdd 100644 --- a/actions/common/common.go +++ b/actions/common/common.go @@ -82,17 +82,17 @@ func GetContextPost(id uint64, t time.Time) (prev, next models.WpPosts, err erro func getPostContext(t time.Time) (prev, next models.WpPosts, err error) { next, err = models.FirstOne[models.WpPosts](models.SqlBuilder{ {"post_date", ">", t.Format("2006-01-02 15:04:05")}, - {"post_status", "publish"}, + {"post_status", "in", ""}, {"post_type", "post"}, - }, "ID,post_title,post_password", nil) + }, "ID,post_title,post_password", nil, []interface{}{"publish", "private"}) if _, ok := PostsCache.Load(next.Id); !ok { } prev, err = models.FirstOne[models.WpPosts](models.SqlBuilder{ {"post_date", "<", t.Format("2006-01-02 15:04:05")}, - {"post_status", "publish"}, + {"post_status", "in", ""}, {"post_type", "post"}, - }, "ID,post_title", models.SqlBuilder{{"post_date", "desc"}}) + }, "ID,post_title", models.SqlBuilder{{"post_date", "desc"}}, []interface{}{"publish", "private"}) return }