From de0332cf8b6116f7bb625f7f127abf69219e9396 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=82=B9=E5=AE=97=E6=A5=A0?= Date: Fri, 15 Sep 2023 09:15:50 +0800 Subject: [PATCH] 1 --- platformapi/mtwmapi/order.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/platformapi/mtwmapi/order.go b/platformapi/mtwmapi/order.go index 8aabe9cd..8587a931 100644 --- a/platformapi/mtwmapi/order.go +++ b/platformapi/mtwmapi/order.go @@ -599,7 +599,10 @@ func (a *API) GetDeliveryPath(orderId int64, appPoiCode string) (lng, lat int, e if err := json.Unmarshal(path, &riderPath); err != nil { return 0, 0, err } - return riderPath[len(riderPath)-1].Longitude, riderPath[len(riderPath)-1].Latitude, nil + if len(riderPath) > 0 { + return riderPath[len(riderPath)-1].Longitude, riderPath[len(riderPath)-1].Latitude, nil + } + return 0, 0, nil } // OrderLogisticsFee 获取订单配送费