$filter = new \yii\base\DynamicModel(['id']); $filter->addRule('id', 'integer'); $filter->load(\Yii::$app->request->get()); if ($filter->id) { $dataProvider->query->andWhere(['id' => $filter->id]); } ?> <? $form = \skeeks\cms\modules\admin\widgets\filters\AdminFiltersForm::begin([ 'action' => '/' . \Yii::$app->request->pathInfo, ]); ?> <?php echo $form->field($filter, 'id')->setVisible(); ?> <? /** * @var $searchModel \skeeks\cms\models\CmsUser */ $searchRelatedPropertiesModel = new \skeeks\cms\models\searchs\SearchRelatedPropertiesModel(); $searchRelatedPropertiesModel->propertyElementClassName = \skeeks\cms\shop\models\ShopBuyerProperty::className(); $searchRelatedPropertiesModel->initProperties($searchModel->relatedProperties); $searchRelatedPropertiesModel->load(\Yii::$app->request->get()); $searchRelatedPropertiesModel->search($dataProvider, $searchModel::tableName()); ?> <?php echo $form->relatedFields($searchRelatedPropertiesModel); ?> <? $form::end(); ?>
/** * @return \yii\db\ActiveQuery */ public function getShopBuyerProperties() { return $this->hasMany(ShopBuyerProperty::className(), ['element_id' => 'id']); }