]);
$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);