- protect jd order isGift

This commit is contained in:
gazebo
2019-02-16 17:45:32 +08:00
parent 2a5d3d3797
commit 128646fcf1

View File

@@ -154,7 +154,7 @@ func (c *PurchaseHandler) Map2Order(orderData map[string]interface{}) (order *mo
if skuCostumeProperty, ok := product["skuCostumeProperty"]; ok { if skuCostumeProperty, ok := product["skuCostumeProperty"]; ok {
sku.SkuName += skuCostumeProperty.(string) sku.SkuName += skuCostumeProperty.(string)
} }
if product["isGift"].(bool) { if isGift, ok := product["isGift"].(bool); ok && isGift {
sku.SkuType = 1 sku.SkuType = 1
} }
order.Skus = append(order.Skus, sku) order.Skus = append(order.Skus, sku)