! GoodsOrder与OrderSku添加VendorPrice表示平台价,而SalePrice表示单品优惠之后的价格
This commit is contained in:
@@ -447,11 +447,13 @@ func RefreshOrderSkuRelated(order *model.GoodsOrder) *model.GoodsOrder {
|
||||
order.SkuCount = 0
|
||||
order.GoodsCount = 0
|
||||
order.SalePrice = 0
|
||||
order.VendorPrice = 0
|
||||
order.Weight = 0
|
||||
for _, sku := range order.Skus {
|
||||
order.SkuCount++
|
||||
order.GoodsCount += sku.Count
|
||||
order.SalePrice += sku.SalePrice * int64(sku.Count)
|
||||
order.VendorPrice += sku.VendorPrice * int64(sku.Count)
|
||||
order.Weight += sku.Weight * sku.Count
|
||||
}
|
||||
return order
|
||||
|
||||
Reference in New Issue
Block a user