fix 修复list报错
This commit is contained in:
parent
c2ccb721a7
commit
9b831ac7d7
@ -58,7 +58,7 @@ func (a *articleApi) Find(query FindArticleQuery) (articles []v2.Article, err er
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (a *articleApi) List(query PageListQuery) (articles []v2.Article, total int64, err error) {
|
func (a *articleApi) List(query PageListQuery) (articles []v2.Article, total int64, err error) {
|
||||||
err = a.db.Scopes(query.Scoper.Scope).Count(&total).Error
|
err = a.db.Scopes(query.Scoper.Scope).Model(&v2.Article{}).Count(&total).Error
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
@ -53,7 +53,7 @@ func (p *providerApi) Get(id uint) (provider v2.Provider, err error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (p *providerApi) List(query PageListQuery) (providers []v2.Provider, total int64, err error) {
|
func (p *providerApi) List(query PageListQuery) (providers []v2.Provider, total int64, err error) {
|
||||||
err = p.db.Scopes(query.Scoper.Scope).Count(&total).Error
|
err = p.db.Scopes(query.Scoper.Scope).Model(&v2.Provider{}).Count(&total).Error
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user