fix bug
This commit is contained in:
parent
d48a156983
commit
e7ea2bf334
|
@ -177,10 +177,15 @@ func MonthPost(args ...any) (r []uint64, err error) {
|
||||||
{"year(post_date)", year},
|
{"year(post_date)", year},
|
||||||
{"month(post_date)", month},
|
{"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
|
return v.Id, true
|
||||||
}, model.Conditions(
|
}, model.Conditions(
|
||||||
model.Fields("ID"),
|
model.Fields("ID"),
|
||||||
model.Where(where),
|
model.Where(where),
|
||||||
))
|
))
|
||||||
|
l := int64(len(r))
|
||||||
|
if l > atomic.LoadInt64(&TotalRaw) {
|
||||||
|
atomic.StoreInt64(&TotalRaw, l)
|
||||||
|
}
|
||||||
|
return
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,7 +14,7 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
var widgetFn = map[string]wp.Components[string]{
|
var widgetFn = map[string]wp.Components[string]{
|
||||||
"search": {Fn: widget.Search, CacheKey: "widgetSearch"},
|
"search": {Fn: widget.Search},
|
||||||
"recent-posts": {Fn: widget.RecentPosts},
|
"recent-posts": {Fn: widget.RecentPosts},
|
||||||
"recent-comments": {Fn: widget.RecentComments},
|
"recent-comments": {Fn: widget.RecentComments},
|
||||||
"archives": {Fn: widget.Archive},
|
"archives": {Fn: widget.Archive},
|
||||||
|
|
Loading…
Reference in New Issue
Block a user