Esempio n. 1
0
 /**
  * Creates data provider instance with search query applied
  *
  * @param array $params
  *
  * @return ActiveDataProvider
  */
 public function search($params)
 {
     $query = Reporte::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_actividad' => $this->id_actividad, 'id_subproceso' => $this->id_subproceso, 'id_usuario' => $this->id_usuario, 'id_via' => $this->id_via, 'id_bd' => $this->id_bd, 'id_organizacion' => $this->id_organizacion, 'id_distrito' => $this->id_distrito, 'id_empresa' => $this->id_empresa, 'id_proyecto' => $this->id_proyecto, 'id_proy_ep' => $this->id_proy_ep, 'id_dato_cargado' => $this->id_dato_cargado, 'ndlis' => $this->ndlis, 'nlis' => $this->nlis, 'nlas' => $this->nlas, 'ntiff' => $this->ntiff, 'npdf' => $this->npdf, 'npds' => $this->npds, 'id_anio_pozo' => $this->id_anio_pozo, 'id_macro' => $this->id_macro, 'id_detallada' => $this->id_detallada, 'fecha_requerimiento' => $this->fecha_requerimiento, 'hora_requerimiento' => $this->hora_requerimiento, 'fecha_atencion' => $this->fecha_atencion, 'hora_ini' => $this->hora_ini, 'hora_fin' => $this->hora_fin, 'HH' => $this->HH, 'id_status' => $this->id_status]);
     $query->andFilterWhere(['like', 'codigo_caso', $this->codigo_caso])->andFilterWhere(['like', 'id_analista', $this->id_analista])->andFilterWhere(['like', 'detalle', $this->detalle])->andFilterWhere(['like', 'pozo', $this->pozo]);
     return $dataProvider;
 }
 /**
  * Finds the Reporte model based on its primary key value.
  * If the model is not found, a 404 HTTP exception will be thrown.
  * @param integer $id
  * @return Reporte the loaded model
  * @throws NotFoundHttpException if the model cannot be found
  */
 protected function findModel($id)
 {
     if (($model = Reporte::findOne($id)) !== null) {
         return $model;
     } else {
         throw new NotFoundHttpException('The requested page does not exist.');
     }
 }