backend/models/EmailsSearch.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 = Emails::find();
        $dataProvider = new ActiveDataProvider([
            'query' => $query,
        ]);
        $this->load($params);
        if (!$this->validate()) {
            return $dataProvider;
        }
        $query->andFilterWhere([
            'email_id' => $this->email_id,
            'user_id' => $this->user_id,
            'time' => $this->time,
            'branch_id' => $this->branch_id,
            'company_id' => $this->company_id,
        ]);
        $query->andFilterWhere(['like', 'receiver_name', $this->receiver_name])
            ->andFilterWhere(['like', 'receiver_email', $this->receiver_email])
            ->andFilterWhere(['like', 'subject', $this->subject])
            ->andFilterWhere(['like', 'content', $this->content])
            ->andFilterWhere(['like', 'attachment', $this->attachment]);
        return $dataProvider;
    }
public function search ( $ params ) { $ query = Emails :: find ( ) ; $ dataProvider = new ActiveDataProvider ( [ 'query' => $ query , ] ) ; $ this -> load ( $ params ) ; if ( ! $ this -> validate ( ) ) { return $ dataProvider ; } $ query -> andFilterWhere ( [ 'email_id' => $ this -> email_id , 'user_id' => $ this -> user_id , 'time' => $ this -> time , 'branch_id' => $ this -> branch_id , 'company_id' => $ this -> company_id , ] ) ; $ query -> andFilterWhere ( [ 'like' , 'receiver_name' , $ this -> receiver_name ] ) -> andFilterWhere ( [ 'like' , 'receiver_email' , $ this -> receiver_email ] ) -> andFilterWhere ( [ 'like' , 'subject' , $ this -> subject ] ) -> andFilterWhere ( [ 'like' , 'content' , $ this -> content ] ) -> andFilterWhere ( [ 'like' , 'attachment' , $ this -> attachment ] ) ; 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