frontend/controllers/DefaultController.php
public function actionGetWarehouses() {

        $street = $_GET['street'];

        $warehouses = $this->getResponse('AddressGeneral', 'getWarehouses',
            ['CityName' => $_GET['CityName']]);

        $warehousesByStreet = [];
        foreach ($warehouses->data['data'] as $warehouse) {
            if (substr_count(mb_strtolower($warehouse['Description']), mb_strtolower($street)) != 0 ||
                substr_count(mb_strtolower($warehouse['DescriptionRu']), mb_strtolower($street))) {
                $warehousesByStreet[] = $warehouse;
            }
        }

        return json_encode($warehousesByStreet);
    }
public function actionGetWarehouses() {

        $street = $_GET['street'];

        $warehouses = $this->getResponse('AddressGeneral', 'getWarehouses',
            ['CityName' => $_GET['CityName']]);

        $warehousesByStreet = [];
        foreach ($warehouses->data['data'] as $warehouse) {
            if (substr_count(mb_strtolower($warehouse['Description']), mb_strtolower($street)) != 0 ||
                substr_count(mb_strtolower($warehouse['DescriptionRu']), mb_strtolower($street))) {
                $warehousesByStreet[] = $warehouse;
            }
        }

        return json_encode($warehousesByStreet);
    }
public function actionGetWarehouses ( ) { $ street = $ _GET [ 'street' ] ; $ warehouses = $ this -> getResponse ( 'AddressGeneral' , 'getWarehouses' , [ 'CityName' => $ _GET [ 'CityName' ] ] ) ; $ warehousesByStreet = [ ] ; foreach ( $ warehouses -> data [ 'data' ] as $ warehouse ) { if ( substr_count ( mb_strtolower ( $ warehouse [ 'Description' ] ) , mb_strtolower ( $ street ) ) != 0 || substr_count ( mb_strtolower ( $ warehouse [ 'DescriptionRu' ] ) , mb_strtolower ( $ street ) ) ) { $ warehousesByStreet [ ] = $ warehouse ; } } return json_encode ( $ warehousesByStreet ) ; }
Gets warehouses by city and street.
@return string
Gets warehouses by city and street .