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