- 设置美团外卖订单的DeliveryType字段

This commit is contained in:
gazebo
2019-09-10 17:51:36 +08:00
parent e873ce0264
commit 7f05b771f4

View File

@@ -122,6 +122,17 @@ func (p *PurchaseHandler) Map2Order(orderData map[string]interface{}) (order *mo
OriginalData: string(utils.MustMarshal(result)),
ActualPayPrice: jxutils.StandardPrice2Int(utils.MustInterface2Float64(result["total"])),
}
pickType := int(utils.Interface2Int64WithDefault(result["pick_type"], 0))
if pickType == mtwmapi.OrderPickTypeSelf {
order.DeliveryType = model.OrderDeliveryTypeSelfTake
} else {
logisticsCode := utils.Interface2String(result["logistics_code"])
if logisticsCode == mtwmapi.PeiSongTypeSelf {
order.DeliveryType = model.OrderDeliveryTypeStoreSelf
} else {
order.DeliveryType = model.OrderDeliveryTypePlatform
}
}
openUID := utils.Interface2Int64WithDefault(result["openUid"], 0)
if openUID > 0 {
order.VendorUserID = utils.Int64ToStr(openUID)