コード例 #1
0
 /**
  * Creates data provider instance with search query applied
  *
  * @param array $params
  *
  * @return ActiveDataProvider
  */
 public function search($ultima = true, $params)
 {
     if ($ultima) {
         $query = TitularidadVista::find()->where(['ultima' => true]);
     } else {
         $query = TitularidadVista::find();
     }
     $pageSize = isset($_GET['per-page']) ? $_GET['per-page'] : \Yii::$app->params['uftitularidad.defaultPageSize'];
     $dataProvider = new ActiveDataProvider(['query' => $query, 'pagination' => ['pageSize' => $pageSize], 'sort' => ['defaultOrder' => ['id' => SORT_ASC], 'enableMultiSort' => true]]);
     $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_titularidad' => $this->id_titularidad, 'id_uf' => $this->id_uf, 'fec_desde' => $this->fec_desde, 'fec_hasta' => $this->fec_hasta, 'id_persona' => $this->id_persona, 'superficie' => $this->superficie]);
     $query->andFilterWhere(['like', 'id', $this->id])->andFilterWhere(['like', 'desc_movim_uf', $this->desc_movim_uf])->andFilterWhere(['like', 'exp_telefono', $this->exp_telefono])->andFilterWhere(['like', 'exp_direccion', $this->exp_direccion])->andFilterWhere(['like', 'exp_localidad', $this->exp_localidad])->andFilterWhere(['like', 'exp_email', $this->exp_email])->andFilterWhere(['like', 'tipo', $this->tipo])->andFilterWhere(['like', 'apellido', $this->apellido])->andFilterWhere(['like', 'nombre', $this->nombre])->andFilterWhere(['like', 'nombre2', $this->nombre2])->andFilterWhere(['like', 'desc_tipo_doc_abr', $this->desc_tipo_doc_abr])->andFilterWhere(['like', 'nro_doc', $this->nro_doc])->andFilterWhere(['like', 'observaciones', $this->observaciones]);
     return $dataProvider;
 }
コード例 #2
0
 /**
  * Finds the TitularidadVista model based on its primary key value.
  * If the model is not found, a 404 HTTP exception will be thrown.
  * @param string $id
  * @return TitularidadVista the loaded model
  * @throws NotFoundHttpException if the model cannot be found
  */
 protected function findModel($id)
 {
     if (($model = TitularidadVista::findOne($id)) !== null) {
         return $model;
     } else {
         throw new NotFoundHttpException('The requested page does not exist.');
     }
 }