- 去掉order相关的无用的一些字段

This commit is contained in:
gazebo
2019-05-08 09:48:04 +08:00
parent 427338aacf
commit b21846f0d3
5 changed files with 0 additions and 39 deletions

View File

@@ -193,30 +193,9 @@ func (c *PurchaseHandler) Map2Order(orderData map[string]interface{}) (order *mo
}
}
jxutils.RefreshOrderSkuRelated(order)
setOrederDetailFee(result, order)
return order
}
func setOrederDetailFee(result map[string]interface{}, order *model.GoodsOrder) {
orderActivities, ok := result["orderActivities"].([]interface{})
if ok {
for _, value := range orderActivities {
activity := value.(map[string]interface{})
categoryId := utils.MustInterface2Int64(activity["categoryId"])
restaurantPart := -jxutils.StandardPrice2Int(utils.MustInterface2Float64(activity["restaurantPart"]))
elemePart := -jxutils.StandardPrice2Int(utils.MustInterface2Float64(activity["elemePart"]))
if _, ok := model.ElmSkuPromotion[int(categoryId)]; ok {
order.SkuPmFee += restaurantPart
order.SkuPmSubsidy += elemePart
} else {
order.OrderPmFee += restaurantPart
order.OrderPmSubsidy += elemePart
}
}
}
order.PlatformFeeRate = int16(utils.MustInterface2Float64(result["serviceRate"]))
}
//
func (c *PurchaseHandler) onOrderNew(msg map[string]interface{}) (response *elmapi.CallbackResponse) {
// todo 这里应该可以直接用msg里的内容而不用再次去查