models/DataSearch.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 = Data::find();
        $dataProvider = new ActiveDataProvider([
            'query' => $query,
        ]);
        $this->load($params);
        if (!$this->validate()) {
            return $dataProvider;
        }
        $query->andFilterWhere([
            'gid' => $this->gid,
            'objectid' => $this->objectid,
            'PIA' => $this->PIA,
            'PIM' => $this->PIM,
        ]);
        $query->andFilterWhere(['like', 'iddist', $this->iddist])
            ->andFilterWhere(['like', 'iddpto', $this->iddpto])
            ->andFilterWhere(['like', 'idprov', $this->idprov])
            ->andFilterWhere(['like', 'nombdist', $this->nombdist])
            ->andFilterWhere(['like', 'nombprov', $this->nombprov])
            ->andFilterWhere(['like', 'nombdep', $this->nombdep])
            ->andFilterWhere(['like', 'nom_cap', $this->nom_cap])
            ->andFilterWhere(['like', 'periodo', $this->periodo]);
        return $dataProvider;
    }
public function search ( $ params ) { $ query = Data :: find ( ) ; $ dataProvider = new ActiveDataProvider ( [ 'query' => $ query , ] ) ; $ this -> load ( $ params ) ; if ( ! $ this -> validate ( ) ) { return $ dataProvider ; } $ query -> andFilterWhere ( [ 'gid' => $ this -> gid , 'objectid' => $ this -> objectid , 'PIA' => $ this -> PIA , 'PIM' => $ this -> PIM , ] ) ; $ query -> andFilterWhere ( [ 'like' , 'iddist' , $ this -> iddist ] ) -> andFilterWhere ( [ 'like' , 'iddpto' , $ this -> iddpto ] ) -> andFilterWhere ( [ 'like' , 'idprov' , $ this -> idprov ] ) -> andFilterWhere ( [ 'like' , 'nombdist' , $ this -> nombdist ] ) -> andFilterWhere ( [ 'like' , 'nombprov' , $ this -> nombprov ] ) -> andFilterWhere ( [ 'like' , 'nombdep' , $ this -> nombdep ] ) -> andFilterWhere ( [ 'like' , 'nom_cap' , $ this -> nom_cap ] ) -> andFilterWhere ( [ 'like' , 'periodo' , $ this -> periodo ] ) ; return $ dataProvider ; }
Creates data provider instance with search query applied
 @param array $params
Creates data provider instance with search query applied @param array $params
// uncomment the following line if you do not want to any records when validation fails // $query->where('0=1');