feat 测试

This commit is contained in:
timerzz 2024-09-06 10:59:51 +08:00
parent 15e36c1180
commit 2fc5434f95
3 changed files with 4 additions and 4 deletions

View File

@ -51,9 +51,9 @@ func (a *articleApi) Upsert(article v2.Article) error {
func (a *articleApi) Update(article v2.Article, selects ...string) error { func (a *articleApi) Update(article v2.Article, selects ...string) error {
if len(selects) > 0 { 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 // ******************Find和List

View File

@ -102,7 +102,7 @@ func (p *providerApi) UpdateStatus(provider v2.Provider) error {
if provider.ID == 0 { if provider.ID == 0 {
return fmt.Errorf("id为空") 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) { func (p *providerApi) Delete(id uint) (provider v2.Provider, err error) {

View File

@ -102,7 +102,7 @@ func (p *sellerApi) UpdateStatus(seller v2.Seller) error {
if seller.ID == 0 { if seller.ID == 0 {
return fmt.Errorf("id为空") 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) { func (p *sellerApi) Delete(id uint) (seller v2.Seller, err error) {