diff --git a/platformapi/mtwmapi/order.go b/platformapi/mtwmapi/order.go index 69fc260c..6e94b8da 100644 --- a/platformapi/mtwmapi/order.go +++ b/platformapi/mtwmapi/order.go @@ -576,13 +576,13 @@ func (a *API) OrderLogisticsFee(orderID int64) (payFee float64, err error) { } data := result.(map[string]interface{}) // 美团运单,骑手确认订单之后取消的话就需要扣除全部的运单费用了,到店之后取消订单也不支付骑手配送费 - //if utils.Interface2Int64WithDefault(data["logistics_status"], 0) == utils.Str2Int64WithDefault(WaybillStatusCanceled, 0) { - // if utils.Interface2Int64WithDefault(data["confirm_time"], 0) != 0 { - // return utils.TryInterface2Float64(data["pay_amount"]) - // } else { - // return 0, nil - // } - //} + if utils.Interface2Int64WithDefault(data["logistics_status"], 0) == utils.Str2Int64WithDefault(WaybillStatusCanceled, 0) { + if utils.Interface2Int64WithDefault(data["dispatcher_reach_poi_time"], 0) != 0 { + return 2, nil + } else { + return 0, nil + } + } return utils.TryInterface2Float64(data["pay_amount"]) } diff --git a/platformapi/mtwmapi/order_test.go b/platformapi/mtwmapi/order_test.go index 43a4c0c5..237d7eee 100644 --- a/platformapi/mtwmapi/order_test.go +++ b/platformapi/mtwmapi/order_test.go @@ -88,7 +88,7 @@ func TestOrderLogisticsStatus(t *testing.T) { } func TestOrderLogisticsFee(t *testing.T) { - result, err := api.OrderLogisticsFee(900697881770969420) + result, err := api.OrderLogisticsFee(900699270657684955) if err != nil { t.Fatal(err) }