Przeglądaj źródła

Merge branch 'develop' of https://gitea.laclic.fr/Laclic/LcShopBundle into develop

feature/export_comptable
Fab 4 lat temu
rodzic
commit
8f67159b2b
2 zmienionych plików z 16 dodań i 3 usunięć
  1. +4
    -1
      ShopBundle/Controller/CitiesController.php
  2. +12
    -2
      ShopBundle/Services/Utils.php

+ 4
- 1
ShopBundle/Controller/CitiesController.php Wyświetl plik

@@ -39,8 +39,11 @@ class CitiesController extends AbstractController

$return = [] ;
foreach($result as $city) {

$codesPostaux = $city->codesPostaux ;

$return[] = [
'label' => $city->nom,
'label' => '<span class="city">'.$city->nom.'</span> <span class="zip">'.$codesPostaux[0].'</span>',
'value' => $city->code
] ;
}

+ 12
- 2
ShopBundle/Services/Utils.php Wyświetl plik

@@ -252,10 +252,20 @@ class Utils
return $result;
}

public function getZipByCity($city)
public function getZipByCity($city, $code = null)
{
$zip = null ;
$returnCitiesSearchZip = json_decode($this->callCitiesApi('get', 'communes', ['nom' => $city, 'fields' => 'nom,codesPostaux'])) ;

$paramsSearch = [
'nom' => $city,
'fields' => 'nom,codesPostaux'
] ;

if($code != null && $code != 0) {
$paramsSearch['code'] = $code ;
}

$returnCitiesSearchZip = json_decode($this->callCitiesApi('get', 'communes', $paramsSearch)) ;

if($returnCitiesSearchZip) {
foreach($returnCitiesSearchZip as $citySearchZip) {

Ładowanie…
Anuluj
Zapisz