fix devops error
This commit is contained in:
@@ -9,20 +9,23 @@ class Cities
|
||||
{
|
||||
public static function getCitiesByName($query)
|
||||
{
|
||||
return City::select('id', DB::raw("concat(nom,' (',code_postal,')') as text"))->where('nom', 'LIKE', "$query%")->orderBy('nom', 'ASC')->take(30)->get();
|
||||
return City::select('id', DB::raw("concat(nom,' (',code_postal,')') as text"))
|
||||
->where('nom', 'LIKE', "{$query}%")
|
||||
->orderBy('nom', 'ASC')->take(30)->get();
|
||||
}
|
||||
|
||||
public static function getCitiesByCP($query)
|
||||
{
|
||||
return City::select('id', DB::raw("concat(nom,' (',code_postal,')') as text"))->where('code_postal', 'LIKE', "%q$guery%")->orderBy('nom', 'ASC')->take(30)->get();
|
||||
return City::select('id', DB::raw("concat(nom,' (',code_postal,')') as text"))
|
||||
->where('code_postal', 'LIKE', "%{$query}%")
|
||||
->orderBy('nom', 'ASC')->take(30)->get();
|
||||
}
|
||||
|
||||
public static function getCPByCity($id)
|
||||
{
|
||||
$ville = self::get($id);
|
||||
$codes = explode('-', $ville->code_postal);
|
||||
|
||||
return $codes;
|
||||
return explode('-', $ville->code_postal);
|
||||
}
|
||||
|
||||
public static function getNomByCity($id)
|
||||
@@ -39,24 +42,15 @@ class Cities
|
||||
|
||||
public static function getCoords($adresse)
|
||||
{
|
||||
// dd(app('geocoder')->geocode('Los Angeles, CA')->get());
|
||||
// dd(app('geocoder')->geocode('5 boulevard du Port, Amiens, France')->get());
|
||||
// dump($adresse);
|
||||
$geocode = app('geocoder')->geocode($adresse)->get();
|
||||
// dump($geocode);
|
||||
if (! count($geocode)) {
|
||||
return false;
|
||||
}
|
||||
// dump($geocode);
|
||||
$res = $geocode[0]->getCoordinates()->toArray();
|
||||
// dump($res);
|
||||
$latitude = $res[0];
|
||||
$longitude = $res[1];
|
||||
|
||||
// dump($latitude);
|
||||
// dump($longitude);
|
||||
return ['latitude' => $latitude, 'longitude' => $longitude];
|
||||
|
||||
}
|
||||
|
||||
public static function getCoordsByCity($id)
|
||||
|
||||
Reference in New Issue
Block a user