/** * Creates data provider instance with search query applied * * @param array $params * * @return ActiveDataProvider */ public function search($params) { $query = AuthRole::find(); $dataProvider = new ActiveDataProvider(['query' => $query]); if (!($this->load($params) && $this->validate())) { return $dataProvider; } $query->andFilterWhere(['id' => $this->id, 'group_id' => $this->group_id, 'company_id' => $this->company_id]); $query->andFilterWhere(['like', 'name', $this->name])->andFilterWhere(['like', 'description', $this->description])->andFilterWhere(['like', 'operation_list', $this->operation_list]); return $dataProvider; }
/** * @return \yii\db\ActiveQuery */ public function getAuthRole() { return $this->hasOne(\common\models\AuthRole::className(), ['id' => 'auth_role']); }