feat upset修改Available

This commit is contained in:
timerzz 2024-09-10 20:11:39 +08:00
parent e076087394
commit 6fd11575b9

View File

@ -89,7 +89,7 @@ func (p *providerArticleApi) Get(query *GetProviderArticleQuery) (article v2.Pro
func (p *providerArticleApi) Upsert(article v2.ProviderArticle) error { func (p *providerArticleApi) Upsert(article v2.ProviderArticle) error {
if err := p.db.Clauses(clause.OnConflict{ if err := p.db.Clauses(clause.OnConflict{
Columns: []clause.Column{{Name: "provider_id"}, {Name: "sku_id"}}, Columns: []clause.Column{{Name: "provider_id"}, {Name: "sku_id"}},
DoUpdates: clause.AssignmentColumns([]string{"cost"}), DoUpdates: clause.AssignmentColumns([]string{"cost", "available"}),
}).Create(&article).Error; err != nil { }).Create(&article).Error; err != nil {
return err return err
} }