Example #1
0
 /**
  * Creates data provider instance with search query applied
  *
  * @param array $params
  *
  * @return ActiveDataProvider
  */
 public function search($params)
 {
     $query = Contenidos::find();
     // add conditions that should always apply here
     $dataProvider = new ActiveDataProvider(['query' => $query, 'sort' => ['defaultOrder' => ['fecha_entrevista' => SORT_DESC]]]);
     $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(['contenido_id' => $this->contenido_id, 'seccion_id' => $this->seccion_id, 'fecha_entrevista' => $this->fecha_entrevista, 'fecha_programacion' => $this->fecha_programacion, 'link_youtube' => $this->link_youtube, 'profesion_id' => $this->profesion_id, 'generado_por_id' => $this->generado_por_id, 'entrevistador_id' => $this->entrevistador_id, 'reconocimiento' => $this->reconocimiento]);
     $query->andFilterWhere(['like', 'no_pauta', $this->no_pauta])->andFilterWhere(['like', 'nombre_talento', $this->nombre_talento])->andFilterWhere(['like', 'redes_sociales_talento', $this->redes_sociales_talento])->andFilterWhere(['like', 'cv_biografia', $this->cv_biografia])->andFilterWhere(['like', 'telefono_oficina', $this->telefono_oficina])->andFilterWhere(['like', 'celular', $this->celular])->andFilterWhere(['like', 'mail', $this->mail])->andFilterWhere(['like', 'direccion_oficina', $this->direccion_oficina]);
     return $dataProvider;
 }