Pārlūkot izejas kodu

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

feature/export_comptable
Fab pirms 4 gadiem
vecāks
revīzija
8f67159b2b
2 mainītis faili ar 16 papildinājumiem un 3 dzēšanām
  1. +4
    -1
      ShopBundle/Controller/CitiesController.php
  2. +12
    -2
      ShopBundle/Services/Utils.php

+ 4
- 1
ShopBundle/Controller/CitiesController.php Parādīt failu

@@ -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 Parādīt failu

@@ -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) {

Notiek ielāde…
Atcelt
Saglabāt