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 {