mirror of
https://github.com/simon-ding/polaris.git
synced 2026-06-26 02:34:58 +08:00
sort desc
This commit is contained in:
3
db/db.go
3
db/db.go
@@ -19,6 +19,7 @@ import (
|
|||||||
"time"
|
"time"
|
||||||
|
|
||||||
"entgo.io/ent/dialect"
|
"entgo.io/ent/dialect"
|
||||||
|
"entgo.io/ent/dialect/sql"
|
||||||
_ "github.com/mattn/go-sqlite3"
|
_ "github.com/mattn/go-sqlite3"
|
||||||
"github.com/pkg/errors"
|
"github.com/pkg/errors"
|
||||||
)
|
)
|
||||||
@@ -430,7 +431,7 @@ func (c *Client) SetHistoryStatus(id int, status history.Status) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (c *Client) GetHistories() ent.Histories {
|
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 {
|
if err != nil {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user