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) {