/**
  * Creates data provider instance with search query applied
  *
  * @param array $params
  *
  * @return ActiveDataProvider
  */
 public function search($params)
 {
     $query = ReclamoSugerencia::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->joinWith('tRS');
     $query->joinWith('tSR');
     $query->joinWith('eRS');
     $query->andFilterWhere(['REC_FECHA' => $this->REC_FECHA, 'REC_HORA' => $this->REC_HORA]);
     $query->andFilterWhere(['like', 'REC_NUMERO', $this->REC_NUMERO])->andFilterWhere(['like', 'USU_RUT', $this->USU_RUT])->andFilterWhere(['like', 'REC_REPARTICION', $this->REC_REPARTICION])->andFilterWhere(['like', 'REC_MOTIVO', $this->REC_MOTIVO])->andFilterWhere(['like', 'REC_VISTO_BUENO', $this->REC_VISTO_BUENO])->andFilterWhere(['like', 'REC_NOMBRE_USUARIO', $this->REC_NOMBRE_USUARIO])->andFilterWhere(['like', 'REC_EMAIL_USUARIO', $this->REC_EMAIL_USUARIO])->andFilterWhere(['like', 'REC_TELEFONO_USUARIO', $this->REC_TELEFONO_USUARIO])->andFilterWhere(['like', 'TRS_TIPO', $this->TRS_ID])->andFilterWhere(['like', 'TSR_TIPO_SOLICITANTE', $this->TSR_ID])->andFilterWhere(['like', 'ERS_ESTADO', $this->ERS_ID]);
     return $dataProvider;
 }
 /**
  * Finds the ReclamoSugerencia model based on its primary key value.
  * If the model is not found, a 404 HTTP exception will be thrown.
  * @param string $id
  * @return ReclamoSugerencia the loaded model
  * @throws NotFoundHttpException if the model cannot be found
  */
 protected function findModel($id)
 {
     if (($model = ReclamoSugerencia::findOne($id)) !== null) {
         return $model;
     } else {
         throw new NotFoundHttpException('The requested page does not exist.');
     }
 }