From 9b831ac7d7b35d8604c4e29eed2cd32e46a8ef99 Mon Sep 17 00:00:00 2001 From: timerzz Date: Mon, 26 Aug 2024 17:51:14 +0800 Subject: [PATCH] =?UTF-8?q?fix=20=E4=BF=AE=E5=A4=8Dlist=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- structs/storage/article.go | 2 +- structs/storage/provider.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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 }