From cbd17ccf6f3bb92f8717b20026e05fe06c4ff193 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=82=B9=E5=AE=97=E6=A5=A0?= Date: Fri, 19 May 2023 18:58:46 +0800 Subject: [PATCH] 1 --- .../jxcallback/auto_delivery/auto_delivery.go | 22 ++++++++++++------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/business/jxcallback/auto_delivery/auto_delivery.go b/business/jxcallback/auto_delivery/auto_delivery.go index 899e02e23..0e93d0087 100644 --- a/business/jxcallback/auto_delivery/auto_delivery.go +++ b/business/jxcallback/auto_delivery/auto_delivery.go @@ -107,15 +107,21 @@ func AutoSettingFakeDelivery() { // 1.根据订单客户地址获取骑手列表 riderKey := "" storeDetail, _ := dao.GetStoreDetail(db, utils.Str2Int(storeIdAndVendorId[0]), 0, "") - place, err := dao.GetParentCodeByCode(db, storeDetail.CityCode) - if err != nil { - globals.SugarLogger.Debugf("根据门店的城市code获取省份code错误: %s", err) - return - } - if strings.Contains(place.Name, "省") { - riderKey = strings.Split(place.Name, "省")[0] + if strings.Contains(storeDetail.Address, "重庆") || strings.Contains(storeDetail.Address, "上海") || strings.Contains(storeDetail.Address, "北京") || strings.Contains(storeDetail.Address, "天津") { + riderKey = strings.Split(storeDetail.Address, "市")[0] + } else if strings.Contains(storeDetail.Address, "省") { + riderKey = strings.Split(storeDetail.Address, "省")[0] } else { - riderKey = strings.Split(place.Name, "市")[0] + place, err := dao.GetParentCodeByCode(db, storeDetail.CityCode) + if err != nil { + globals.SugarLogger.Debugf("根据门店的城市code获取省份code错误: %s", err) + return + } + if strings.Contains(place.Name, "省") { + riderKey = strings.Split(place.Name, "省")[0] + } else { + riderKey = strings.Split(place.Name, "市")[0] + } } for _, v := range orderList {