common/models/search/User.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
@return ActiveDataProvider
Creates data provider instance with search query applied @param array $params @return ActiveDataProvider
public function search($params)
    {
        $query = UserModel::find();
        $query->andWhere(['<>', 'id', Yii::$app->user->id]);
        $dataProvider = new ActiveDataProvider([
            'query' => $query,
            'sort' => [
                'defaultOrder' => [
                    'id' => SORT_DESC,
                ],
            ],
        ]);
        $this->load($params);
        if (!$this->validate()) {
            return $dataProvider;
        }
        $query->andFilterWhere([
            'id' => $this->id,
            'status' => $this->status,
        ]);
        $query->andFilterWhere(['like', 'username', $this->username])
            ->andFilterWhere(['like', 'email', $this->email])
            ->andFilterWhere(['like', 'full_name', $this->full_name])
            ->andFilterWhere(['like', 'display_name', $this->display_name])
            ->andFilterWhere(['like', 'password_hash', $this->password_hash])
            ->andFilterWhere(['like', 'password_reset_token', $this->password_reset_token])
            ->andFilterWhere(['like', 'auth_key', $this->auth_key])
            ->andFilterWhere(['like', 'created_at', $this->created_at])
            ->andFilterWhere(['like', 'updated_at', $this->updated_at])
            ->andFilterWhere(['like', 'login_at', $this->login_at]);
        return $dataProvider;
    }
public function search ( $ params ) { $ query = UserModel :: find ( ) ; $ query -> andWhere ( [ '<>' , 'id' , Yii :: $ app -> user -> id ] ) ; $ dataProvider = new ActiveDataProvider ( [ 'query' => $ query , 'sort' => [ 'defaultOrder' => [ 'id' => SORT_DESC , ] , ] , ] ) ; $ this -> load ( $ params ) ; if ( ! $ this -> validate ( ) ) { return $ dataProvider ; } $ query -> andFilterWhere ( [ 'id' => $ this -> id , 'status' => $ this -> status , ] ) ; $ query -> andFilterWhere ( [ 'like' , 'username' , $ this -> username ] ) -> andFilterWhere ( [ 'like' , 'email' , $ this -> email ] ) -> andFilterWhere ( [ 'like' , 'full_name' , $ this -> full_name ] ) -> andFilterWhere ( [ 'like' , 'display_name' , $ this -> display_name ] ) -> andFilterWhere ( [ 'like' , 'password_hash' , $ this -> password_hash ] ) -> andFilterWhere ( [ 'like' , 'password_reset_token' , $ this -> password_reset_token ] ) -> andFilterWhere ( [ 'like' , 'auth_key' , $ this -> auth_key ] ) -> andFilterWhere ( [ 'like' , 'created_at' , $ this -> created_at ] ) -> andFilterWhere ( [ 'like' , 'updated_at' , $ this -> updated_at ] ) -> andFilterWhere ( [ 'like' , 'login_at' , $ this -> login_at ] ) ; return $ dataProvider ; }
Creates data provider instance with search query applied
 @param array $params
 @return ActiveDataProvider
Creates data provider instance with search query applied @param array $params @return ActiveDataProvider