diff --git a/internal/pkg/dao/posts.go b/internal/pkg/dao/posts.go index fc4ba23..120e7c3 100644 --- a/internal/pkg/dao/posts.go +++ b/internal/pkg/dao/posts.go @@ -177,10 +177,15 @@ func MonthPost(args ...any) (r []uint64, err error) { {"year(post_date)", year}, {"month(post_date)", month}, } - return model.Column[models.Posts, uint64](ctx, func(v models.Posts) (uint64, bool) { + r, err = model.Column[models.Posts, uint64](ctx, func(v models.Posts) (uint64, bool) { return v.Id, true }, model.Conditions( model.Fields("ID"), model.Where(where), )) + l := int64(len(r)) + if l > atomic.LoadInt64(&TotalRaw) { + atomic.StoreInt64(&TotalRaw, l) + } + return } diff --git a/internal/theme/wp/components/widgetareadata.go b/internal/theme/wp/components/widgetareadata.go index 8e162ab..30527b3 100644 --- a/internal/theme/wp/components/widgetareadata.go +++ b/internal/theme/wp/components/widgetareadata.go @@ -14,7 +14,7 @@ import ( ) var widgetFn = map[string]wp.Components[string]{ - "search": {Fn: widget.Search, CacheKey: "widgetSearch"}, + "search": {Fn: widget.Search}, "recent-posts": {Fn: widget.RecentPosts}, "recent-comments": {Fn: widget.RecentComments}, "archives": {Fn: widget.Archive},