修改美团配送费

This commit is contained in:
邹宗楠
2022-03-01 17:59:43 +08:00
parent f4c41c6f92
commit 2d38ef4307
5 changed files with 18 additions and 13 deletions

View File

@@ -118,9 +118,10 @@ type OrderInfo struct {
}
type OrderResponse struct {
MtPeisongID string `json:"mt_peisong_id"`
DeliveryID int64 `json:"delivery_id"`
OrderID string `json:"order_id"`
MtPeisongID string `json:"mt_peisong_id"`
DeliveryID int64 `json:"delivery_id"`
OrderID string `json:"order_id"`
DeliveryFee float64 `json:"delivery_fee"`
}
type ResponseResult struct {
@@ -287,11 +288,13 @@ func (a *API) AccessAPI(action string, params map[string]interface{}) (retVal *R
return a.AccessAPI2(mtpsAPIURL, action, params)
}
// 获取美团配送内部订单id外部系统订单id美团配送费用
func (a *API) result2OrderResponse(result *ResponseResult) (order *OrderResponse) {
order = new(OrderResponse)
order.MtPeisongID = result.Data["mt_peisong_id"].(string)
order.DeliveryID = utils.MustInterface2Int64(result.Data["delivery_id"])
order.OrderID = result.Data["order_id"].(string)
order.DeliveryFee = utils.MustInterface2Float64(result.Data["delivery_fee"])
return order
}
@@ -311,6 +314,7 @@ func (a *API) CreateOrderByShop(basicParams *CreateOrderByShopParam, addParams m
}
}
// 获取美团订单费用
func (a *API) CreateOrderByShop2(basicParams *CreateOrderByShopParam) (order *OrderResponse, err error) {
params := utils.Struct2MapByJson(basicParams)
if basicParams.OrderType != OrderTypeBook {