From: Aleksey Filippov Date: Wed, 1 Apr 2026 14:41:26 +0000 (+0300) Subject: fix(BC-248): actionGetStores — вернуть UUID из Products1c вместо числового ID из... X-Git-Url: https://gitweb.erp-flowers.ru/?a=commitdiff_plain;h=54cbb95fe48a3823321002b3ba522634f31b636c;p=erp24_rep%2Fyii-erp24%2F.git fix(BC-248): actionGetStores — вернуть UUID из Products1c вместо числового ID из CityStore Max-бот ожидает UUID магазинов (Products1c.id), а не числовой ID из CityStore. Удалён закомментированный дубликат метода. --- 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]);