models/VehiculoSearch.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 = Vehiculo::find();
        $dataProvider = new ActiveDataProvider([
            'query' => $query,
        ]);
        $this->load($params);
        if (!$this->validate()) {
            return $dataProvider;
        }
		$query->joinWith('eMPRESA');
        $query->andFilterWhere([
            'ID' => $this->ID,
            'CAPACIDAD' => $this->CAPACIDAD,
            'SROP' => $this->SROP,
            'NRO_PRC' => $this->NRO_PRC,
            'FE_VENCE_PRC' => $this->FE_VENCE_PRC,
        ]);
        $query->andFilterWhere(['like', 'PLACA_CHUTO', $this->PLACA_CHUTO])
            ->andFilterWhere(['like', 'MARCA', $this->MARCA])
            ->andFilterWhere(['like', 'MODELO', $this->MODELO])
            ->andFilterWhere(['like', 'SERIAL', $this->SERIAL])
            ->andFilterWhere(['like', 'PLACA_REMOLQUE', $this->PLACA_REMOLQUE])
            ->andFilterWhere(['like', 'COLOR', $this->COLOR])
            ->andFilterWhere(['like', 'IMG_CARNET', $this->IMG_CARNET])
            ->andFilterWhere(['like', 'ESTATUS', $this->ESTATUS])
			->andFilterWhere(['like', 'eMPRESA.NOMBRE', $this->EMPRESA_ID]);
        return $dataProvider;
    }
public function search ( $ params ) { $ query = Vehiculo :: find ( ) ; $ dataProvider = new ActiveDataProvider ( [ 'query' => $ query , ] ) ; $ this -> load ( $ params ) ; if ( ! $ this -> validate ( ) ) { return $ dataProvider ; } $ query -> joinWith ( 'eMPRESA' ) ; $ query -> andFilterWhere ( [ 'ID' => $ this -> ID , 'CAPACIDAD' => $ this -> CAPACIDAD , 'SROP' => $ this -> SROP , 'NRO_PRC' => $ this -> NRO_PRC , 'FE_VENCE_PRC' => $ this -> FE_VENCE_PRC , ] ) ; $ query -> andFilterWhere ( [ 'like' , 'PLACA_CHUTO' , $ this -> PLACA_CHUTO ] ) -> andFilterWhere ( [ 'like' , 'MARCA' , $ this -> MARCA ] ) -> andFilterWhere ( [ 'like' , 'MODELO' , $ this -> MODELO ] ) -> andFilterWhere ( [ 'like' , 'SERIAL' , $ this -> SERIAL ] ) -> andFilterWhere ( [ 'like' , 'PLACA_REMOLQUE' , $ this -> PLACA_REMOLQUE ] ) -> andFilterWhere ( [ 'like' , 'COLOR' , $ this -> COLOR ] ) -> andFilterWhere ( [ 'like' , 'IMG_CARNET' , $ this -> IMG_CARNET ] ) -> andFilterWhere ( [ 'like' , 'ESTATUS' , $ this -> ESTATUS ] ) -> andFilterWhere ( [ 'like' , 'eMPRESA.NOMBRE' , $ this -> EMPRESA_ID ] ) ; 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