From: fomichev Date: Thu, 13 Feb 2025 10:09:39 +0000 (+0300) Subject: Исправление X-Git-Url: https://gitweb.erp-flowers.ru/?a=commitdiff_plain;h=d50804c70361dfca7619c7eca301dab8ef51b377;p=erp24_rep%2Fyii-erp24%2F.git Исправление --- diff --git a/erp24/controllers/CityStoreParamsController.php b/erp24/controllers/CityStoreParamsController.php index 9566e32a..4f19fde2 100644 --- a/erp24/controllers/CityStoreParamsController.php +++ b/erp24/controllers/CityStoreParamsController.php @@ -266,10 +266,10 @@ class CityStoreParamsController extends Controller public function actionGetAddressData() { - $params = Yii::$app->request->post()['depdrop_all_params'] ?? []; + $params = Yii::$app->request->post('depdrop_all_params', []); if (isset($params['region'])) { - $cities = StoreCityList::findAll(['parent_id' => $params['region'], 'type' => StoreCityList::TYPE_CITY]); + $cities = StoreCityList::findAll(['parent_id' => (int)$params['region'], 'type' => StoreCityList::TYPE_CITY]); if (!empty($cities)) { $cityList = array_map(fn($city) => ['id' => $city->id, 'name' => $city->name], $cities); @@ -281,7 +281,7 @@ class CityStoreParamsController extends Controller } if (isset($params['city'])) { - $districts = StoreCityList::findAll(['parent_id' => $params['city'], 'type' => StoreCityList::TYPE_DISTRICT]); + $districts = StoreCityList::findAll(['parent_id' => (int)$params['city'], 'type' => StoreCityList::TYPE_DISTRICT]); if (!empty($districts)) { $districtList = array_map(fn($district) => ['id' => $district->id, 'name' => $district->name], $districts);