+ 添加GoodsOrder.TotalShopMoney表示应结金额-第三方平台结算给京西的金额(包括了所有的补贴,扣除)

This commit is contained in:
gazebo
2019-06-18 10:17:24 +08:00
parent 0f4f6b937f
commit c64140fdcf
4 changed files with 61 additions and 18 deletions

View File

@@ -118,7 +118,6 @@ func (p *PurchaseHandler) Map2Order(orderData map[string]interface{}) (order *mo
StatusTime: getTimeFromTimestamp(utils.MustInterface2Int64(result["ctime"])),
OriginalData: string(utils.MustMarshal(result)),
ActualPayPrice: jxutils.StandardPrice2Int(utils.MustInterface2Float64(result["total"])),
Skus: []*model.OrderSku{},
}
if utils.IsTimeZero(order.PickDeadline) && !utils.IsTimeZero(order.StatusTime) {
order.PickDeadline = order.StatusTime.Add(pickupOrderDelay) // 美团外卖要求在5分钟内拣货不然订单会被取消
@@ -202,6 +201,17 @@ func (p *PurchaseHandler) Map2Order(orderData map[string]interface{}) (order *mo
}
}
}
if poiReceiveDetailStr := utils.Interface2String(result["poi_receive_detail"]); poiReceiveDetailStr != "" {
var poiReceiveDetail *mtwmapi.PoiReceiveDetailInfo
utils.UnmarshalUseNumber([]byte(poiReceiveDetailStr), &poiReceiveDetail)
if poiReceiveDetail != nil {
order.TotalShopMoney = poiReceiveDetail.WmPoiReceiveCent
for _, v := range poiReceiveDetail.ActOrderChargeByMt {
order.TotalShopMoney += v.MoneyCent
}
}
}
// if product["isGift"].(bool) {
// sku.SkuType = 1
// }