feat upset修改Available
This commit is contained in:
parent
e076087394
commit
6fd11575b9
@ -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
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user