使用腾讯地图,百度和高德不在使用
This commit is contained in:
@@ -57,14 +57,14 @@ func getStorePageInfo(ctx *jxcontext.Context, handler partner.IPurchasePlatformN
|
||||
|
||||
func updatePageShopCityDistrictInfo(ctx *jxcontext.Context, storePageInfo *model.PageShop, cityCode int) {
|
||||
if !(storePageInfo.Lng != 0 && storePageInfo.Lat != 0) {
|
||||
storePageInfo.Lng, storePageInfo.Lat, storePageInfo.DistrictCode = api.AutonaviAPI.GetCoordinateFromAddress(storePageInfo.Address, utils.Int2Str(cityCode))
|
||||
storePageInfo.Lng, storePageInfo.Lat, storePageInfo.DistrictCode, _, _ = api.TencentMapAPI.GetCoordinateFromAddress(storePageInfo.Address, utils.Int2Str(cityCode))
|
||||
if storePageInfo.DistrictCode == 0 && cityCode != 0 {
|
||||
if place, err := dao.GetPlaceByCode(dao.GetDB(), cityCode); err == nil {
|
||||
storePageInfo.Lng, storePageInfo.Lat, storePageInfo.DistrictCode = api.AutonaviAPI.GetCoordinateFromAddress(storePageInfo.Address, utils.Int2Str(place.ParentCode))
|
||||
storePageInfo.Lng, storePageInfo.Lat, storePageInfo.DistrictCode, _, _ = api.TencentMapAPI.GetCoordinateFromAddress(storePageInfo.Address, utils.Int2Str(place.ParentCode))
|
||||
}
|
||||
}
|
||||
} else if storePageInfo.DistrictCode == 0 {
|
||||
storePageInfo.DistrictCode = api.AutonaviAPI.GetCoordinateDistrictCode(storePageInfo.Lng, storePageInfo.Lat)
|
||||
storePageInfo.DistrictCode = api.TencentMapAPI.GetCoordinateDistrictCode(storePageInfo.Lng, storePageInfo.Lat)
|
||||
}
|
||||
if storePageInfo.CityCode == 0 {
|
||||
if storePageInfo.DistrictCode != 0 {
|
||||
|
||||
Reference in New Issue
Block a user