From d5b9180f7dc8c15d60e23f1a4cfdccba3743cec9 Mon Sep 17 00:00:00 2001 From: Alexander Smirnov Date: Thu, 25 Jul 2024 15:58:22 +0300 Subject: [PATCH] =?utf8?q?=D0=A4=D0=B8=D0=BB=D1=8C=D1=82=D1=80=20=D0=BF?= =?utf8?q?=D0=BE=D0=BA=D0=B0=D0=B7=D1=8B=D0=B2=D0=B0=D0=B5=D1=82=20=D1=82?= =?utf8?q?=D0=BE=D0=BB=D1=8C=D0=BA=D0=BE=20=D0=B4=D0=BE=D1=81=D1=82=D1=83?= =?utf8?q?=D0=BF=D0=BD=D1=8B=D0=B5=20=D0=B7=D0=BD=D0=B0=D1=87=D0=B5=D0=BD?= =?utf8?q?=D0=B8=D1=8F=20=D0=B8=20=D0=B4=D0=BB=D1=8F=20=D0=BC=D0=B0=D0=B3?= =?utf8?q?=D0=B0=D0=B7=D0=B8=D0=BD=D0=BE=D0=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- erp24/actions/motivation/IndexAction.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/erp24/actions/motivation/IndexAction.php b/erp24/actions/motivation/IndexAction.php index 15aad57e..6c3c7ae4 100644 --- a/erp24/actions/motivation/IndexAction.php +++ b/erp24/actions/motivation/IndexAction.php @@ -38,9 +38,14 @@ class IndexAction extends Action ]); $model->load(Yii::$app->request->get()); + $motivations = Motivation::find()->all(); + $possibleStoreIds = ArrayHelper::getColumn($motivations, 'store_id'); + $stores = ArrayHelper::map(CityStore::find()->all(), 'id', 'name'); + $stores = array_filter($stores, function ($k, $v) use($possibleStoreIds) { + return in_array($v, $possibleStoreIds); + }, ARRAY_FILTER_USE_BOTH); - $motivations = Motivation::find()->all(); $possibleYears = ArrayHelper::getColumn($motivations, 'year'); $years = array_filter(range(2023, 20100), function ($k) use ($possibleYears) { return in_array($k, $possibleYears); -- 2.39.5