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

View File

@@ -107,6 +107,11 @@ func AutoSettingFakeDelivery() {
// 1.根据订单客户地址获取骑手列表 // 1.根据订单客户地址获取骑手列表
riderKey := "" riderKey := ""
storeDetail, _ := dao.GetStoreDetail(db, utils.Str2Int(storeIdAndVendorId[0]), 0, "") storeDetail, _ := dao.GetStoreDetail(db, utils.Str2Int(storeIdAndVendorId[0]), 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 {
place, err := dao.GetParentCodeByCode(db, storeDetail.CityCode) place, err := dao.GetParentCodeByCode(db, storeDetail.CityCode)
if err != nil { if err != nil {
globals.SugarLogger.Debugf("根据门店的城市code获取省份code错误: %s", err) globals.SugarLogger.Debugf("根据门店的城市code获取省份code错误: %s", err)
@@ -117,6 +122,7 @@ func AutoSettingFakeDelivery() {
} else { } else {
riderKey = strings.Split(place.Name, "市")[0] riderKey = strings.Split(place.Name, "市")[0]
} }
}
for _, v := range orderList { for _, v := range orderList {
if len(riderListInfo[riderKey]) == model.NO { if len(riderListInfo[riderKey]) == model.NO {