diff --git a/structs/storage/article.go b/structs/storage/article.go index 7f1d3d4..759a866 100644 --- a/structs/storage/article.go +++ b/structs/storage/article.go @@ -111,7 +111,7 @@ func (a *articleApi) List(query PageListQuery) (articles []v2.Article, total int if err != nil { return } - err = a.db.Scopes(query.Scope).Find(&articles).Error + err = a.db.Scopes(query.Scope).Order("id").Find(&articles).Error return } diff --git a/structs/storage/provider.go b/structs/storage/provider.go index cfbd460..c208b9f 100644 --- a/structs/storage/provider.go +++ b/structs/storage/provider.go @@ -63,7 +63,7 @@ func (p *providerApi) List(query PageListQuery) (providers []v2.Provider, total if err != nil { return } - err = p.db.Scopes(query.Scope).Find(&providers).Error + err = p.db.Scopes(query.Scope).Order("id DESC").Find(&providers).Error return } diff --git a/structs/storage/seller.go b/structs/storage/seller.go index 7f6b39e..8543888 100644 --- a/structs/storage/seller.go +++ b/structs/storage/seller.go @@ -63,7 +63,7 @@ func (p *sellerApi) List(query PageListQuery) (sellers []v2.Seller, total int64, if err != nil { return } - err = p.db.Scopes(query.Scope).Find(&sellers).Error + err = p.db.Scopes(query.Scope).Order("id DESC").Find(&sellers).Error return }