models/ProgramasSearch.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 = Programas::find();
        $dataProvider = new ActiveDataProvider([
            'query' => $query,
        ]);
        $this->load($params);
        if (!$this->validate()) {
            return $dataProvider;
        }
        $query->andFilterWhere([
            'prg_id' => $this->prg_id,
            'carre_id' => $this->carre_id,
            'mate_id' => $this->mate_id,
            'cate_id' => $this->cate_id,
            'pln_id' => $this->pln_id,
            'vale_desde' => $this->vale_desde,
            'vale_hasta' => $this->vale_hasta,
        ]);
        $query->andFilterWhere(['like', 'archivo', $this->archivo])
            ->andFilterWhere(['like', 'activo', $this->activo]);
        return $dataProvider;
    }
public function search ( $ params ) { $ query = Programas :: find ( ) ; $ dataProvider = new ActiveDataProvider ( [ 'query' => $ query , ] ) ; $ this -> load ( $ params ) ; if ( ! $ this -> validate ( ) ) { return $ dataProvider ; } $ query -> andFilterWhere ( [ 'prg_id' => $ this -> prg_id , 'carre_id' => $ this -> carre_id , 'mate_id' => $ this -> mate_id , 'cate_id' => $ this -> cate_id , 'pln_id' => $ this -> pln_id , 'vale_desde' => $ this -> vale_desde , 'vale_hasta' => $ this -> vale_hasta , ] ) ; $ query -> andFilterWhere ( [ 'like' , 'archivo' , $ this -> archivo ] ) -> andFilterWhere ( [ 'like' , 'activo' , $ this -> activo ] ) ; return $ dataProvider ; }
Creates data provider instance with search query applied
Creates data provider instance with search query applied
// uncomment the following line if you do not want to return any records when validation fails // $query->where('0=1');