models/PacientesSearch.php
/**
     * Creates data provider instance with search query applied
     *
     * @param array $params
     *
     * @return ActiveDataProvider
     */
Creates data provider instance with search query applied
@param array $params


Creates data provider instance with search query applied @param array $params
public function search($params)
    {
        $query = Pacientes::find();
        $dataProvider = new ActiveDataProvider([
            'query' => $query,
        ]);
        $this->load($params);
        if (!$this->validate()) {
            return $dataProvider;
        }
        $query->andFilterWhere([
            'id' => $this->id,
            'peso' => $this->peso,
            'altura' => $this->altura,
            'nacimiento' => $this->nacimiento,
            'costo' => $this->costo,
            'pago' => $this->pago,
        ]);
        $query->andFilterWhere(['like', 'nombre', $this->nombre])
            ->andFilterWhere(['like', 'paterno', $this->paterno])
            ->andFilterWhere(['like', 'materno', $this->materno])
            ->andFilterWhere(['like', 'genero', $this->genero])
            ->andFilterWhere(['like', 'telefono', $this->telefono])
            ->andFilterWhere(['like', 'movil', $this->movil])
            ->andFilterWhere(['like', 'email', $this->email])
            ->andFilterWhere(['like', 'calle', $this->calle])
            ->andFilterWhere(['like', 'numero', $this->numero])
            ->andFilterWhere(['like', 'interior', $this->interior])
            ->andFilterWhere(['like', 'colonia', $this->colonia])
            ->andFilterWhere(['like', 'cp', $this->cp])
            ->andFilterWhere(['like', 'ciudad', $this->ciudad])
            ->andFilterWhere(['like', 'diagnostico', $this->diagnostico]);
        return $dataProvider;
    }
public function search ( $ params ) { $ query = Pacientes :: find ( ) ; $ dataProvider = new ActiveDataProvider ( [ 'query' => $ query , ] ) ; $ this -> load ( $ params ) ; if ( ! $ this -> validate ( ) ) { return $ dataProvider ; } $ query -> andFilterWhere ( [ 'id' => $ this -> id , 'peso' => $ this -> peso , 'altura' => $ this -> altura , 'nacimiento' => $ this -> nacimiento , 'costo' => $ this -> costo , 'pago' => $ this -> pago , ] ) ; $ query -> andFilterWhere ( [ 'like' , 'nombre' , $ this -> nombre ] ) -> andFilterWhere ( [ 'like' , 'paterno' , $ this -> paterno ] ) -> andFilterWhere ( [ 'like' , 'materno' , $ this -> materno ] ) -> andFilterWhere ( [ 'like' , 'genero' , $ this -> genero ] ) -> andFilterWhere ( [ 'like' , 'telefono' , $ this -> telefono ] ) -> andFilterWhere ( [ 'like' , 'movil' , $ this -> movil ] ) -> andFilterWhere ( [ 'like' , 'email' , $ this -> email ] ) -> andFilterWhere ( [ 'like' , 'calle' , $ this -> calle ] ) -> andFilterWhere ( [ 'like' , 'numero' , $ this -> numero ] ) -> andFilterWhere ( [ 'like' , 'interior' , $ this -> interior ] ) -> andFilterWhere ( [ 'like' , 'colonia' , $ this -> colonia ] ) -> andFilterWhere ( [ 'like' , 'cp' , $ this -> cp ] ) -> andFilterWhere ( [ 'like' , 'ciudad' , $ this -> ciudad ] ) -> andFilterWhere ( [ 'like' , 'diagnostico' , $ this -> diagnostico ] ) ; return $ dataProvider ; }
Creates data provider instance with search query applied
 @param array $params
Creates data provider instance with search query applied @param array $params
// add conditions that should always apply here // uncomment the following line if you do not want to return any records when validation fails // $query->where('0=1'); // grid filtering conditions