feat seller-article 中upsert根据id更新
This commit is contained in:
parent
23573b3150
commit
0222ab4539
@ -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
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user