Sort based on published at

This commit is contained in:
LittleSheep 2024-07-22 01:44:40 +08:00
parent f5664715f8
commit 96b36c1db4

View File

@ -123,7 +123,7 @@ func ListPost(tx *gorm.DB, take int, offset int, noReact ...bool) ([]*models.Pos
var items []*models.Post
if err := tx.
Limit(take).Offset(offset).
Order("created_at DESC").
Order("published_at DESC").
Preload("Tags").
Preload("Categories").
Preload("Realm").