backend/models/DemandesSearch.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 = Demandes::find();
        $dataProvider = new ActiveDataProvider([
            'query' => $query,
        ]);
        $this->load($params);
        if (!$this->validate()) {
            return $dataProvider;
        }
        $query->andFilterWhere([
            'demand_id' => $this->demand_id,
            'demand_created_date' => $this->demand_created_date,
            'demand_update_date' => $this->demand_update_date,
            'demand_begin_date' => $this->demand_begin_date,
            'demand_end_date' => $this->demand_end_date,
        ]);
        $query->andFilterWhere(['like', 'demand_name', $this->demand_name])
            ->andFilterWhere(['like', 'demand_status', $this->demand_status])
            ->andFilterWhere(['like', 'demand_leading', $this->demand_leading])
            ->andFilterWhere(['like', 'demand_remarks', $this->demand_remarks]);
        return $dataProvider;
    }
public function search ( $ params ) { $ query = Demandes :: find ( ) ; $ dataProvider = new ActiveDataProvider ( [ 'query' => $ query , ] ) ; $ this -> load ( $ params ) ; if ( ! $ this -> validate ( ) ) { return $ dataProvider ; } $ query -> andFilterWhere ( [ 'demand_id' => $ this -> demand_id , 'demand_created_date' => $ this -> demand_created_date , 'demand_update_date' => $ this -> demand_update_date , 'demand_begin_date' => $ this -> demand_begin_date , 'demand_end_date' => $ this -> demand_end_date , ] ) ; $ query -> andFilterWhere ( [ 'like' , 'demand_name' , $ this -> demand_name ] ) -> andFilterWhere ( [ 'like' , 'demand_status' , $ this -> demand_status ] ) -> andFilterWhere ( [ 'like' , 'demand_leading' , $ this -> demand_leading ] ) -> andFilterWhere ( [ 'like' , 'demand_remarks' , $ this -> demand_remarks ] ) ; 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