From 54cbb95fe48a3823321002b3ba522634f31b636c Mon Sep 17 00:00:00 2001 From: Aleksey Filippov Date: Wed, 1 Apr 2026 17:41:26 +0300 Subject: [PATCH] =?utf8?q?fix(BC-248):=20actionGetStores=20=E2=80=94=20?= =?utf8?q?=D0=B2=D0=B5=D1=80=D0=BD=D1=83=D1=82=D1=8C=20UUID=20=D0=B8=D0=B7?= =?utf8?q?=20Products1c=20=D0=B2=D0=BC=D0=B5=D1=81=D1=82=D0=BE=20=D1=87?= =?utf8?q?=D0=B8=D1=81=D0=BB=D0=BE=D0=B2=D0=BE=D0=B3=D0=BE=20ID=20=D0=B8?= =?utf8?q?=D0=B7=20CityStore?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Max-бот ожидает UUID магазинов (Products1c.id), а не числовой ID из CityStore. Удалён закомментированный дубликат метода. --- erp24/api2/controllers/ClientController.php | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/erp24/api2/controllers/ClientController.php b/erp24/api2/controllers/ClientController.php index 9a9dbe93..55174ca4 100644 --- a/erp24/api2/controllers/ClientController.php +++ b/erp24/api2/controllers/ClientController.php @@ -1141,23 +1141,13 @@ class ClientController extends BaseController return $this->asJson(['response' => $mess]); } -// public function actionGetStores() { -// $stores = Products1c::find()->with('store')->where(['tip' => 'city_store'])->andWhere(['view' => '1'])->all(); -// $result = []; -// foreach ($stores as $store) { -// if (!empty($store->store->name ?? null)) { -// $result [] = ['guid' => $store->id ?? null, 'id' => $store->store->id ?? null, 'name' => $store->store->name ?? null]; -// } -// } -// return $this->asJson(['response' => $result]); -// } public function actionGetStores() { - $stores = CityStore::find()->all(); + $stores = Products1c::find()->with('store')->where(['tip' => 'city_store'])->andWhere(['view' => '1'])->all(); $result = []; foreach ($stores as $store) { - if (!empty($store->name ?? null)) { - $result [] = ['id' => $store->id, 'name' => $store->name]; + if (!empty($store->store->name ?? null)) { + $result[] = ['id' => $store->id, 'name' => $store->store->name]; } } return $this->asJson(['response' => $result]); -- 2.39.5