- 设置美团外卖订单的DeliveryType字段
This commit is contained in:
@@ -122,6 +122,17 @@ func (p *PurchaseHandler) Map2Order(orderData map[string]interface{}) (order *mo
|
|||||||
OriginalData: string(utils.MustMarshal(result)),
|
OriginalData: string(utils.MustMarshal(result)),
|
||||||
ActualPayPrice: jxutils.StandardPrice2Int(utils.MustInterface2Float64(result["total"])),
|
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)
|
openUID := utils.Interface2Int64WithDefault(result["openUid"], 0)
|
||||||
if openUID > 0 {
|
if openUID > 0 {
|
||||||
order.VendorUserID = utils.Int64ToStr(openUID)
|
order.VendorUserID = utils.Int64ToStr(openUID)
|
||||||
|
|||||||
Reference in New Issue
Block a user