backend/models/BranchesSearch.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 = Branches::find();
        $dataProvider = new ActiveDataProvider([
            'query' => $query,
        ]);
        $this->load($params);
        if (!$this->validate()) {
            return $dataProvider;
        }
        $query->joinWith('companiesCompany');
        $query->andFilterWhere([
            'branch_id' => $this->branch_id,
            'branch_create_date' => $this->branch_create_date,
        ]);
        $query->andFilterWhere(['like', 'branch_name', $this->branch_name])
            ->andFilterWhere(['like', 'branch_address', $this->branch_address])
            ->andFilterWhere(['like', 'branch_status', $this->branch_status])
            ->andFilterWhere(['like', 'companies.Company_name', $this->companies_company_id]);
        return $dataProvider;
    }
public function search ( $ params ) { $ query = Branches :: find ( ) ; $ dataProvider = new ActiveDataProvider ( [ 'query' => $ query , ] ) ; $ this -> load ( $ params ) ; if ( ! $ this -> validate ( ) ) { return $ dataProvider ; } $ query -> joinWith ( 'companiesCompany' ) ; $ query -> andFilterWhere ( [ 'branch_id' => $ this -> branch_id , 'branch_create_date' => $ this -> branch_create_date , ] ) ; $ query -> andFilterWhere ( [ 'like' , 'branch_name' , $ this -> branch_name ] ) -> andFilterWhere ( [ 'like' , 'branch_address' , $ this -> branch_address ] ) -> andFilterWhere ( [ 'like' , 'branch_status' , $ this -> branch_status ] ) -> andFilterWhere ( [ 'like' , 'companies.Company_name' , $ this -> companies_company_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 //search with company id must be clear--- //   'companies_company_id' => $this->companies_company_id,