This commit is contained in:
suyl
2021-05-19 17:05:17 +08:00
parent 07ebec3775
commit f98b1dfa2e

View File

@@ -4280,8 +4280,13 @@ func RefreshPageStore() {
if v.Lat == "" && v.Lng == "" { if v.Lat == "" && v.Lng == "" {
if v.BakInfo != "" { if v.BakInfo != "" {
result, _ := api.AutonaviAPI.GetCoordinateFromAddressAll(v.Address, v.BakInfo) result, _ := api.AutonaviAPI.GetCoordinateFromAddressAll(v.Address, v.BakInfo)
v.Lng, v.Lat, v.DistrictName = utils.Float64ToStr(result.Lng), utils.Float64ToStr(result.Lat), result.AdName sql := `
dao.UpdateEntity(db, v, "Lng", "Lat", "DistrictName") UPDATE jingdong_showd SET lng = ?, lat = ?, district_name = ? WHERE id = ?
`
sqlparams := []interface{}{
utils.Float64ToStr(result.Lng), utils.Float64ToStr(result.Lat), result.AdName, v.ID,
}
dao.ExecuteSQL(db, sql, sqlparams)
} }
} }
} }
@@ -4293,8 +4298,13 @@ func RefreshPageStore() {
if v.Lat == "" && v.Lng == "" { if v.Lat == "" && v.Lng == "" {
if v.CityName != "" { if v.CityName != "" {
result, _ := api.AutonaviAPI.GetCoordinateFromAddressAll(v.Address, v.CityName) result, _ := api.AutonaviAPI.GetCoordinateFromAddressAll(v.Address, v.CityName)
v.Lng, v.Lat, v.DistrictName = utils.Float64ToStr(result.Lng), utils.Float64ToStr(result.Lat), result.AdName sql := `
dao.UpdateEntity(db, v, "Lng", "Lat", "DistrictName") UPDATE meituan_showd SET lng = ?, lat = ?, district_name = ? WHERE id = ?
`
sqlparams := []interface{}{
utils.Float64ToStr(result.Lng), utils.Float64ToStr(result.Lat), result.AdName, v.ID,
}
dao.ExecuteSQL(db, sql, sqlparams)
} }
} }
} }