使用腾讯地图,百度和高德不在使用
This commit is contained in:
@@ -382,7 +382,7 @@ func setUserAddress(db *dao.DaoDB, user *model.User, order *model.GoodsOrder) {
|
||||
user.DistrictCode = store.DistrictCode
|
||||
} else if dao.IsNoRowsError(err) {
|
||||
if order.ConsigneeLng != 0 && order.ConsigneeLat != 0 {
|
||||
if user.DistrictCode = api.AutonaviAPI.GetCoordinateDistrictCode(jxutils.IntCoordinate2Standard(order.ConsigneeLng), jxutils.IntCoordinate2Standard(order.ConsigneeLat)); user.DistrictCode > 0 {
|
||||
if user.DistrictCode = api.TencentMapAPI.GetCoordinateDistrictCode(jxutils.IntCoordinate2Standard(order.ConsigneeLng), jxutils.IntCoordinate2Standard(order.ConsigneeLat)); user.DistrictCode > 0 {
|
||||
if placeInfo, err := dao.GetPlaceByCode(db, user.DistrictCode); err == nil {
|
||||
user.CityCode = placeInfo.ParentCode
|
||||
}
|
||||
@@ -658,10 +658,10 @@ func DeleteUsers4Role(ctx *jxcontext.Context, r *authz.RoleInfo, userIDList []st
|
||||
}
|
||||
|
||||
func getAddressInfoFromCoord(db *dao.DaoDB, lng, lat float64) (formattedAddress string, districtCode, cityCode int, err error) {
|
||||
regeoInfo, err := api.AutonaviAPI.GeoCodeRegeoSingle(lng, lat, 0, false, nil, 0, 0)
|
||||
regeoInfo, err := api.TencentMapAPI.GeoCodeRegeoSingle(lng, lat, 0, false, nil, 0, 0)
|
||||
if err == nil {
|
||||
formattedAddress = regeoInfo.FormattedAddress
|
||||
districtCode = int(utils.Str2Int64WithDefault(regeoInfo.AddressComponent.Adcode, 0))
|
||||
formattedAddress = regeoInfo.Result.Address
|
||||
districtCode = int(utils.Str2Int64WithDefault(regeoInfo.Result.AdInfo.Adcode, 0))
|
||||
if districtCode == 0 {
|
||||
err = fmt.Errorf("坐标lng:%f,lat:%f找不到位置信息", lng, lat)
|
||||
} else if districtInfo, err2 := dao.GetPlaceByCode(db, districtCode); err2 == nil {
|
||||
|
||||
Reference in New Issue
Block a user