feat 给数据库操作加上order by
This commit is contained in:
parent
4e3069f229
commit
7677cd470a
@ -111,7 +111,7 @@ func (a *articleApi) List(query PageListQuery) (articles []v2.Article, total int
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
err = a.db.Scopes(query.Scope).Find(&articles).Error
|
err = a.db.Scopes(query.Scope).Order("id").Find(&articles).Error
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -63,7 +63,7 @@ func (p *providerApi) List(query PageListQuery) (providers []v2.Provider, total
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
err = p.db.Scopes(query.Scope).Find(&providers).Error
|
err = p.db.Scopes(query.Scope).Order("id DESC").Find(&providers).Error
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -63,7 +63,7 @@ func (p *sellerApi) List(query PageListQuery) (sellers []v2.Seller, total int64,
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
err = p.db.Scopes(query.Scope).Find(&sellers).Error
|
err = p.db.Scopes(query.Scope).Order("id DESC").Find(&sellers).Error
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user