From 2fc5434f95f975e6f02ad997e771b9ae21b77d29 Mon Sep 17 00:00:00 2001 From: timerzz Date: Fri, 6 Sep 2024 10:59:51 +0800 Subject: [PATCH] =?UTF-8?q?feat=20=E6=B5=8B=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- structs/storage/article.go | 4 ++-- structs/storage/provider.go | 2 +- structs/storage/seller.go | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/structs/storage/article.go b/structs/storage/article.go index e933d67..8f73a2a 100644 --- a/structs/storage/article.go +++ b/structs/storage/article.go @@ -51,9 +51,9 @@ func (a *articleApi) Upsert(article v2.Article) error { func (a *articleApi) Update(article v2.Article, selects ...string) error { if len(selects) > 0 { - selects = []string{"Remark", "Exclude"} + selects = []string{"remark", "exclude"} } - return a.db.Model(&article).Debug().Select(selects).Omit(clause.Associations).Updates(article).Error + return a.db.Debug().Select(selects).Omit(clause.Associations).Updates(article).Error } // ******************Find和List diff --git a/structs/storage/provider.go b/structs/storage/provider.go index c208b9f..b5574de 100644 --- a/structs/storage/provider.go +++ b/structs/storage/provider.go @@ -102,7 +102,7 @@ func (p *providerApi) UpdateStatus(provider v2.Provider) error { if provider.ID == 0 { return fmt.Errorf("id为空") } - return p.db.Model(&provider).Where("id=?", provider.ID).Select("status", "msg", "pull_at").Updates(&provider).Error + return p.db.Where("id=?", provider.ID).Select("status", "msg", "pull_at").Updates(&provider).Error } func (p *providerApi) Delete(id uint) (provider v2.Provider, err error) { diff --git a/structs/storage/seller.go b/structs/storage/seller.go index 8543888..b3cfa01 100644 --- a/structs/storage/seller.go +++ b/structs/storage/seller.go @@ -102,7 +102,7 @@ func (p *sellerApi) UpdateStatus(seller v2.Seller) error { if seller.ID == 0 { return fmt.Errorf("id为空") } - return p.db.Model(&seller).Where("id=?", seller.ID).Select("status", "msg", "pull_at").Updates(&seller).Error + return p.db.Where("id=?", seller.ID).Select("status", "msg", "pull_at").Updates(&seller).Error } func (p *sellerApi) Delete(id uint) (seller v2.Seller, err error) {