joinWith('lang'); $dataProvider = new ActiveDataProvider([ 'query' => $query, 'sort' => [ 'attributes' => [ 'tax_option_id', 'value' => [ 'asc' => [ 'tax_option_lang.value' => SORT_ASC ], 'desc' => [ 'tax_option_lang.value' => SORT_DESC ], ], ], ], ]); $this->load($params); // if (!$this->validate()) { // return $dataProvider; // } // grid filtering conditions $query->andFilterWhere([ 'tax_option_id' => $this->tax_option_id, ]) ->andFilterWhere([ 'like', 'tax_option_lang.value', $this->value, ]); return $dataProvider; } }