- GoodsOrder添加DiscountMoney

This commit is contained in:
gazebo
2019-09-06 17:25:36 +08:00
parent b10ed6d97d
commit f3a99cf2cd
4 changed files with 16 additions and 5 deletions

View File

@@ -201,7 +201,11 @@ func (c *PurchaseHandler) Map2Order(orderData map[string]interface{}) (order *mo
}
order.ConsigneeLng = jxutils.StandardCoordinate2Int(originalLng)
order.ConsigneeLat = jxutils.StandardCoordinate2Int(originalLat)
// discounts := result["discount"].(map[string]interface{})
discounts, _ := result["discount"].(map[string]interface{})
for _, v := range discounts {
discount := v.(map[string]interface{})
order.DiscountMoney += utils.Interface2Int64WithDefault(discount["discountPrice"], 0)
}
for _, product2 := range result["product"].([]interface{}) {
product := product2.(map[string]interface{})
sku := &model.OrderSku{