|
@@ -60,8 +60,7 @@ class MigrateAddressToLatLngCommand extends ContainerAwareCommand
|
|
|
$objects = $q->getResult();
|
|
|
$geoDecode = new GeoDecode();
|
|
|
foreach ($objects as $nap) {
|
|
|
- $extra = json_decode($nap->getExtraData(), true);
|
|
|
- $arr = $geoDecode->searchLatLng($extra['Address'], $city, $state, $country, $region);
|
|
|
+ $arr = $geoDecode->searchLatLng($nap->getAddress(), $city, $state, $country, $region);
|
|
|
$show = $nap->getId() . " - " . $nap->getName() . ". ";
|
|
|
// divido por 1000 para pasar a km
|
|
|
$dist = abs($geoDecode->distanceGeoPoints($latitude, $longitude, $arr['lat'], $arr['lng'])) / 1000;
|
|
@@ -78,7 +77,7 @@ class MigrateAddressToLatLngCommand extends ContainerAwareCommand
|
|
|
$em->persist($nap);
|
|
|
$em->flush();
|
|
|
} else {
|
|
|
- $show .= "Error: Address=" . $extra['Address'] . " - City=$city - State=$state - Country=$country - Distance=$dist";
|
|
|
+ $show .= "Error: Address=" . $nap->getAddress() . " - City=$city - State=$state - Country=$country - Distance=$dist";
|
|
|
}
|
|
|
$output->writeln($show);
|
|
|
}
|