/** * Creates data provider instance with search query applied * * @param array $params * * @return ActiveDataProvider */ public function search($params) { $query = College::find(); $dataProvider = new ActiveDataProvider(['query' => $query]); $this->load($params); if (!$this->validate()) { // uncomment the following line if you do not want to return any records when validation fails // $query->where('0=1'); return $dataProvider; } $query->andFilterWhere(['id' => $this->id]); $query->andFilterWhere(['like', 'college_to_apply1', $this->college_to_apply1])->andFilterWhere(['like', 'college_to_apply2', $this->college_to_apply2])->andFilterWhere(['like', 'course_to_take1', $this->course_to_take1])->andFilterWhere(['like', 'course_to_take2', $this->course_to_take2]); return $dataProvider; }
/** * Creates data provider instance with search query applied * * @param array $params * * @return ActiveDataProvider */ public function search($params) { $query = College::find(); // add conditions that should always apply here $dataProvider = new ActiveDataProvider(['query' => $query]); $this->load($params); if (!$this->validate()) { // uncomment the following line if you do not want to return any records when validation fails // $query->where('0=1'); return $dataProvider; } // grid filtering conditions $query->andFilterWhere(['id' => $this->id, 'university_id' => $this->university_id, 'establish' => $this->establish, 'statutory_body_id' => $this->statutory_body_id, 'important_links_id' => $this->important_links_id, 'download_links_id' => $this->download_links_id, 'is_featured' => $this->is_featured, 'created' => $this->created, 'modified' => $this->modified, 'status' => $this->status, 'college_image_id' => $this->college_image_id]); $query->andFilterWhere(['like', 'name', $this->name])->andFilterWhere(['like', 'description', $this->description])->andFilterWhere(['like', 'website', $this->website])->andFilterWhere(['like', 'logo', $this->logo])->andFilterWhere(['like', 'banner', $this->banner]); return $dataProvider; }