feat seller-article 中upsert根据id更新

This commit is contained in:
timerzz 2024-09-02 19:39:46 +08:00
parent 23573b3150
commit 0222ab4539

View File

@ -82,7 +82,7 @@ func (p *sellerArticleApi) Get(query *GetSellerArticleQuery) (article v2.SellerA
func (p *sellerArticleApi) Upsert(article v2.SellerArticle) error { func (p *sellerArticleApi) Upsert(article v2.SellerArticle) error {
return p.db.Clauses(clause.OnConflict{ return p.db.Clauses(clause.OnConflict{
Columns: []clause.Column{{Name: "seller_id"}, {Name: "sku_id"}}, Columns: []clause.Column{{Name: "id"}},
DoUpdates: clause.AssignmentColumns([]string{"sell", "exclude"}), DoUpdates: clause.AssignmentColumns([]string{"sell", "exclude"}),
}).Create(&article).Error }).Create(&article).Error
} }