This commit is contained in:
parent
8f70b150b0
commit
29c79beb5f
@ -86,10 +86,10 @@ func (c *Controller) saveRespData(list []coach_client.Product) error {
|
||||
return item.Id == color.VgId
|
||||
})
|
||||
// 获取已经存的运费
|
||||
var saveFreight float64
|
||||
c.db.Model(&productv1.Product{}).Where("pid = ?", color.VgId).Select("freight").Scan(&saveFreight)
|
||||
if saveFreight > 0 {
|
||||
c.Freight = saveFreight
|
||||
var savedProduct productv1.Product
|
||||
c.db.Model(&savedProduct).Where("pid = ?", color.VgId).Select("freight", "dw_price").Scan(&savedProduct)
|
||||
if savedProduct.Freight == 0 {
|
||||
savedProduct.Freight = c.Freight
|
||||
}
|
||||
products = append(products, productv1.Product{
|
||||
UpdatedAt: time.Now(),
|
||||
@ -101,8 +101,9 @@ func (c *Controller) saveRespData(list []coach_client.Product) error {
|
||||
Orderable: color.Orderable,
|
||||
DiscPercent: price.Price.MarkdownDiscPercent,
|
||||
USPrice: price.Price.Sales.Value,
|
||||
Freight: c.Freight,
|
||||
Freight: savedProduct.Freight,
|
||||
ExchangeRate: c.ExchangeRate,
|
||||
DWPrice: savedProduct.DWPrice,
|
||||
})
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user