Kaynağa Gözat

update

three
DengBiao 1 yıl önce
ebeveyn
işleme
e9305769e4
1 değiştirilmiş dosya ile 18 ekleme ve 17 silme
  1. +18
    -17
      consume/canal_guide_order_consume.go

+ 18
- 17
consume/canal_guide_order_consume.go Dosyayı Görüntüle

@@ -144,28 +144,29 @@ func getUserAddress(Db *xorm.Engine, uid string, geoIp2db *geoip2.DBReader) (pro
"key": "uid",
"value": uid,
})
if err != nil {
if err != nil || userLoginIpList == nil {
provinceName = "广东省"
provinceId = "440000000000"
return
}
if userLoginIpList != nil {
utils.FilePutContents("getUserAddress", utils.SerializeStr(userLoginIpList))
record, _ := geoIp2db.City(net.ParseIP(userLoginIpList.NowIp))
if record.Country.Names != nil && record.Subdivisions != nil && record.City.Names != nil {
province, err := db.ProvinceGetOneByName(record.Subdivisions[0].Names["zh-CN"])
if err != nil {
return
}
provinceId = province.Id
provinceName = province.Name

city, err := db.CityGetOneByName(record.City.Names["zh-CN"])
if err != nil {
return
}
cityId = city.Id
cityName = city.Name
utils.FilePutContents("getUserAddress", utils.SerializeStr(userLoginIpList))
record, _ := geoIp2db.City(net.ParseIP(userLoginIpList.NowIp))
if record.Country.Names != nil && record.Subdivisions != nil && record.City.Names != nil {
province, err := db.ProvinceGetOneByName(record.Subdivisions[0].Names["zh-CN"])
if err != nil {
return
}
provinceId = province.Id
provinceName = province.Name

city, err := db.CityGetOneByName(record.City.Names["zh-CN"])
if err != nil {
return
}
cityId = city.Id
cityName = city.Name
return
}
//TODO::没开区域代理的,默认归属到广东
provinceName = "广东省"


Yükleniyor…
İptal
Kaydet