From dfb3e22c93ab8bef5139d250686d8321a06d9450 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=82=B9=E5=AE=97=E6=A5=A0?= Date: Tue, 29 Aug 2023 15:01:33 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=BE=8E=E5=9B=A2=E8=B7=91?= =?UTF-8?q?=E8=85=BF=E5=8F=96=E6=B6=88=E8=AE=A2=E5=8D=95=E7=9A=84=E8=BF=9D?= =?UTF-8?q?=E7=BA=A6=E9=87=91=E6=89=A3=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- platformapi/mtwmapi/order.go | 14 +++++++------- platformapi/mtwmapi/order_test.go | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) 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) }