Compare commits

..

No commits in common. "285bb98158a8da5053bb608300e3e4d1a7fee249" and "44514fbf39c8a55d5d3b1fae18039ec76da71359" have entirely different histories.

3 changed files with 4 additions and 5 deletions

View File

@ -22,9 +22,9 @@ func TestCAClient(t *testing.T) {
//}
//t.Log(resp)
inv, err := client.RequestProductDetail(ctx, "CP150-LHBLK")
resp, err := client.RequestProductDetailList(ctx, "CK535-WEC", "CP081-SVVSW", "C9949-SVVDT", "CM235-SVELC", "CP081-JIBLK", "CAA92-IMCHR", "C9949-SVQVE", "CW637-B4CED")
if err != nil {
t.Fatal(err)
}
t.Log(inv)
t.Log(resp)
}

View File

@ -37,7 +37,7 @@ func (a *articleApi) Upsert(article v2.Article) error {
return a.db.Transaction(func(tx *gorm.DB) error {
if err := tx.Clauses(clause.OnConflict{
Columns: []clause.Column{{Name: "pid"}, {Name: "brand"}},
DoUpdates: clause.AssignmentColumns([]string{"available", "updated_at", "cost_price", "sell_price", "rate", "GrossProfit", "remark", "exclude"}),
DoUpdates: clause.AssignmentColumns([]string{"available", "updated_at", "cost_price", "sell_price", "rate", "remark", "exclude"}),
}).Create(&article).Error; err != nil {
return err
}

View File

@ -42,8 +42,7 @@ type Article struct {
// 销售商报价列表
Sellers []SellerArticle `json:"sellers" gorm:"foreignKey:ArticleID"`
// 利润率
Rate float64 `json:"rate" gorm:"index"` //利润率
GrossProfit float64 `json:"grossProfit"` //毛利润
Rate float64 `json:"rate" gorm:"index"` //利润率
//备注
Remark string `json:"remark"`
}