mirror of
https://github.com/simon-ding/polaris.git
synced 2026-03-06 17:40:46 +08:00
sort desc
This commit is contained in:
3
db/db.go
3
db/db.go
@@ -19,6 +19,7 @@ import (
|
||||
"time"
|
||||
|
||||
"entgo.io/ent/dialect"
|
||||
"entgo.io/ent/dialect/sql"
|
||||
_ "github.com/mattn/go-sqlite3"
|
||||
"github.com/pkg/errors"
|
||||
)
|
||||
@@ -430,7 +431,7 @@ func (c *Client) SetHistoryStatus(id int, status history.Status) error {
|
||||
}
|
||||
|
||||
func (c *Client) GetHistories() ent.Histories {
|
||||
h, err := c.ent.History.Query().All(context.TODO())
|
||||
h, err := c.ent.History.Query().Order(history.ByID(sql.OrderDesc())).All(context.TODO())
|
||||
if err != nil {
|
||||
return nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user