models/CargaSearch.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 = Carga::find();
        $dataProvider = new ActiveDataProvider([
            'query' => $query,
        ]);
        $this->load($params);
        if (!$this->validate()) {
            return $dataProvider;
        }
        $query->joinWith('rUBROS');
        $query->joinWith('pAIS');
        $query->joinWith('bUQUE');
        $query->andFilterWhere([
            'ID' => $this->ID,
            'TIPO_CARGA_ID' => $this->TIPO_CARGA_ID,
            'PUERTO_ID' => $this->PUERTO_ID,
            'FECHA_ATRAQUE' => $this->FECHA_ATRAQUE,
            'BL' => $this->BL,
            'MUELLE' => $this->MUELLE,
            'PESO' => $this->PESO,
            'PESO_ASIGNADO' => $this->PESO_ASIGNADO,
            'ESTATUS_CARGA' => $this->ESTATUS_CARGA,
            'PESO_DISTRIBUIDO' => $this->PESO_DISTRIBUIDO,
            'FECHA_REGISTRO' => $this->FECHA_REGISTRO,
        ]);
        $query->andFilterWhere(['like', 'COD_VIAJE', $this->COD_VIAJE])
            ->andFilterWhere(['like', 'DESCRIPCION', $this->DESCRIPCION])
            ->andFilterWhere(['like', 'OBSERVACIONES', $this->OBSERVACIONES])
            ->andFilterWhere(['like', 'rUBROS.NOMBRE', $this->RUBROS_ID])
            ->andFilterWhere(['like', 'pAIS.NOMBRE', $this->PAIS_ID])
            ->andFilterWhere(['like', 'bUQUE.NOMBRE', $this->BUQUE_ID]);
        return $dataProvider;
    }
public function search ( $ params ) { $ query = Carga :: find ( ) ; $ dataProvider = new ActiveDataProvider ( [ 'query' => $ query , ] ) ; $ this -> load ( $ params ) ; if ( ! $ this -> validate ( ) ) { return $ dataProvider ; } $ query -> joinWith ( 'rUBROS' ) ; $ query -> joinWith ( 'pAIS' ) ; $ query -> joinWith ( 'bUQUE' ) ; $ query -> andFilterWhere ( [ 'ID' => $ this -> ID , 'TIPO_CARGA_ID' => $ this -> TIPO_CARGA_ID , 'PUERTO_ID' => $ this -> PUERTO_ID , 'FECHA_ATRAQUE' => $ this -> FECHA_ATRAQUE , 'BL' => $ this -> BL , 'MUELLE' => $ this -> MUELLE , 'PESO' => $ this -> PESO , 'PESO_ASIGNADO' => $ this -> PESO_ASIGNADO , 'ESTATUS_CARGA' => $ this -> ESTATUS_CARGA , 'PESO_DISTRIBUIDO' => $ this -> PESO_DISTRIBUIDO , 'FECHA_REGISTRO' => $ this -> FECHA_REGISTRO , ] ) ; $ query -> andFilterWhere ( [ 'like' , 'COD_VIAJE' , $ this -> COD_VIAJE ] ) -> andFilterWhere ( [ 'like' , 'DESCRIPCION' , $ this -> DESCRIPCION ] ) -> andFilterWhere ( [ 'like' , 'OBSERVACIONES' , $ this -> OBSERVACIONES ] ) -> andFilterWhere ( [ 'like' , 'rUBROS.NOMBRE' , $ this -> RUBROS_ID ] ) -> andFilterWhere ( [ 'like' , 'pAIS.NOMBRE' , $ this -> PAIS_ID ] ) -> andFilterWhere ( [ 'like' , 'bUQUE.NOMBRE' , $ this -> BUQUE_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