diff --git a/structs/storage/article.go b/structs/storage/article.go index bba912a..f8e4537 100644 --- a/structs/storage/article.go +++ b/structs/storage/article.go @@ -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) { - 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 { return } diff --git a/structs/storage/provider.go b/structs/storage/provider.go index 631b7fb..f20e918 100644 --- a/structs/storage/provider.go +++ b/structs/storage/provider.go @@ -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) { - 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 { return }