This commit is contained in:
邹宗楠
2023-05-19 18:58:46 +08:00
parent 20cda2be44
commit cbd17ccf6f

View File

@@ -107,15 +107,21 @@ func AutoSettingFakeDelivery() {
// 1.根据订单客户地址获取骑手列表 // 1.根据订单客户地址获取骑手列表
riderKey := "" riderKey := ""
storeDetail, _ := dao.GetStoreDetail(db, utils.Str2Int(storeIdAndVendorId[0]), 0, "") storeDetail, _ := dao.GetStoreDetail(db, utils.Str2Int(storeIdAndVendorId[0]), 0, "")
place, err := dao.GetParentCodeByCode(db, storeDetail.CityCode) if strings.Contains(storeDetail.Address, "重庆") || strings.Contains(storeDetail.Address, "上海") || strings.Contains(storeDetail.Address, "北京") || strings.Contains(storeDetail.Address, "天津") {
if err != nil { riderKey = strings.Split(storeDetail.Address, "市")[0]
globals.SugarLogger.Debugf("根据门店的城市code获取省份code错误: %s", err) } else if strings.Contains(storeDetail.Address, "省") {
return riderKey = strings.Split(storeDetail.Address, "省")[0]
}
if strings.Contains(place.Name, "省") {
riderKey = strings.Split(place.Name, "省")[0]
} else { } 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 { for _, v := range orderList {