backend/models/search/BadLoginsSearch.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 = BadLogins::find();
        $dataProvider = new ActiveDataProvider([
            'query' => $query,
            'sort'=> [
                'defaultOrder' => [
                    'bl_locked'=>SORT_DESC,
                    'bl_lock_seconds' => SORT_DESC,
                    'bl_last_timestamp' => SORT_DESC,
                ],
                'attributes' => [
                    'bl_locked',
                    'bl_lock_seconds',
                    'bl_last_timestamp',
                    'bl_ip',
                    'bl_id',
                    'bl_count_tries',
                    'bl_created',
                    'bl_updated',
                    'bl_type',
                ]
            ],
        ]);
        $this->load($params);
        if (!$this->validate()) {
            return $dataProvider;
        }
        $query->andFilterWhere([
            'bl_id' => $this->bl_id,
            'bl_created' => $this->bl_created,
            'bl_updated' => $this->bl_updated,
            'bl_count_tries' => $this->bl_count_tries,
            'bl_last_timestamp' => $this->bl_last_timestamp,
            'bl_locked' => $this->bl_locked,
            'bl_lock_seconds' => $this->bl_lock_seconds,
            'bl_type' => $this->bl_type,
        ]);
        $query->andFilterWhere(['ilike', 'bl_ip', $this->bl_ip]);
        return $dataProvider;
    }
public function search ( $ params ) { $ query = BadLogins :: find ( ) ; $ dataProvider = new ActiveDataProvider ( [ 'query' => $ query , 'sort' => [ 'defaultOrder' => [ 'bl_locked' => SORT_DESC , 'bl_lock_seconds' => SORT_DESC , 'bl_last_timestamp' => SORT_DESC , ] , 'attributes' => [ 'bl_locked' , 'bl_lock_seconds' , 'bl_last_timestamp' , 'bl_ip' , 'bl_id' , 'bl_count_tries' , 'bl_created' , 'bl_updated' , 'bl_type' , ] ] , ] ) ; $ this -> load ( $ params ) ; if ( ! $ this -> validate ( ) ) { return $ dataProvider ; } $ query -> andFilterWhere ( [ 'bl_id' => $ this -> bl_id , 'bl_created' => $ this -> bl_created , 'bl_updated' => $ this -> bl_updated , 'bl_count_tries' => $ this -> bl_count_tries , 'bl_last_timestamp' => $ this -> bl_last_timestamp , 'bl_locked' => $ this -> bl_locked , 'bl_lock_seconds' => $ this -> bl_lock_seconds , 'bl_type' => $ this -> bl_type , ] ) ; $ query -> andFilterWhere ( [ 'ilike' , 'bl_ip' , $ this -> bl_ip ] ) ; 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