public function search($params)
    {
        $query = static::find();

        $dataProvider = new ActiveDataProvider(['query' => $query]);
        $dataProvider->sort->defaultOrder = ['id' => SORT_DESC];
        $dataProvider->pagination->pageSize = Yii::$app->session->get('per-page', 20);

        if (!($this->load($params) && $this->validate())) {
            return $dataProvider;
        }

        $query
            ->andFilterWhere(['id' => $this->id])
            ->andFilterWhere(['level' => $this->level])
            ->andFilterWhere(['model' => $this->model])
            ->andFilterWhere(['user' => $this->user])
            ->andFilterWhere(['like', 'category', $this->category])
            ->andFilterWhere(['like', 'ip', $this->ip])
            ->andFilterWhere(['like', 'message', $this->message]);

        return $dataProvider;
    }
public function search($params)
    {
        $query = static::find();

        $dataProvider = new ActiveDataProvider(['query' => $query]);
        $dataProvider->sort->defaultOrder = ['id' => SORT_DESC];
        $dataProvider->pagination->pageSize = Yii::$app->session->get('per-page', 20);

        if (!($this->load($params) && $this->validate())) {
            return $dataProvider;
        }

        $query
            ->andFilterWhere(['id' => $this->id])
            ->andFilterWhere(['level' => $this->level])
            ->andFilterWhere(['model' => $this->model])
            ->andFilterWhere(['user' => $this->user])
            ->andFilterWhere(['like', 'category', $this->category])
            ->andFilterWhere(['like', 'ip', $this->ip])
            ->andFilterWhere(['like', 'message', $this->message]);

        return $dataProvider;
    }
public function search ( $ params ) { $ query = static :: find ( ) ; $ dataProvider = new ActiveDataProvider ( [ 'query' => $ query ] ) ; $ dataProvider -> sort -> defaultOrder = [ 'id' => SORT_DESC ] ; $ dataProvider -> pagination -> pageSize = Yii :: $ app -> session -> get ( 'per-page' , 20 ) ; if ( ! ( $ this -> load ( $ params ) && $ this -> validate ( ) ) ) { return $ dataProvider ; } $ query -> andFilterWhere ( [ 'id' => $ this -> id ] ) -> andFilterWhere ( [ 'level' => $ this -> level ] ) -> andFilterWhere ( [ 'model' => $ this -> model ] ) -> andFilterWhere ( [ 'user' => $ this -> user ] ) -> andFilterWhere ( [ 'like' , 'category' , $ this -> category ] ) -> andFilterWhere ( [ 'like' , 'ip' , $ this -> ip ] ) -> andFilterWhere ( [ 'like' , 'message' , $ this -> message ] ) ; return $ dataProvider ; }
Searches for logs.
@param array $params Attributes
@return ActiveDataProvider
Searches for logs .