frontend/models/search/UserNodeSearch.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 = UserNode::find()->indexBy('node_id');
        $dataProvider = new ActiveDataProvider([
            'query' => $query,
            'sort'=> [
                'defaultOrder' => ['node_id'=>SORT_DESC],
                'attributes' => [
                    'node_id',
                    'node_name',
                    'node_last_ip',
                    'node_countrycode',
                    'node_country',
                    'node_city',
                    'node_online',
                    'node_updated',
                    'node_useragent',
                    'node_osname',
                    'node_ostype',
                    'node_devicetype',
                    'node_upload_speed',
                    'node_download_speed',
                    'node_disk_usage',
                    'node_status',
                ]
            ],
            'pagination' => false,
        ]);
        $query->andWhere('node_status NOT IN (:DELETED, :DEACTIVATED) AND NOT((node_prev_status = :DEACTIVATED) AND (node_status IN (:LOGGEDOUT, :WIPED)))', [
            'DELETED'     => self::STATUS_DELETED,
            'DEACTIVATED' => self::STATUS_DEACTIVATED,
            'LOGGEDOUT'   => self::STATUS_LOGGEDOUT,
            'WIPED'       => self::STATUS_WIPED,
        ]);
        $query->andFilterWhere($params);
        return $dataProvider;
    }
public function search ( $ params ) { $ query = UserNode :: find ( ) -> indexBy ( 'node_id' ) ; $ dataProvider = new ActiveDataProvider ( [ 'query' => $ query , 'sort' => [ 'defaultOrder' => [ 'node_id' => SORT_DESC ] , 'attributes' => [ 'node_id' , 'node_name' , 'node_last_ip' , 'node_countrycode' , 'node_country' , 'node_city' , 'node_online' , 'node_updated' , 'node_useragent' , 'node_osname' , 'node_ostype' , 'node_devicetype' , 'node_upload_speed' , 'node_download_speed' , 'node_disk_usage' , 'node_status' , ] ] , 'pagination' => false , ] ) ; $ query -> andWhere ( 'node_status NOT IN (:DELETED, :DEACTIVATED) AND NOT((node_prev_status = :DEACTIVATED) AND (node_status IN (:LOGGEDOUT, :WIPED)))' , [ 'DELETED' => self :: STATUS_DELETED , 'DEACTIVATED' => self :: STATUS_DEACTIVATED , 'LOGGEDOUT' => self :: STATUS_LOGGEDOUT , 'WIPED' => self :: STATUS_WIPED , ] ) ; $ query -> andFilterWhere ( $ params ) ; 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
//'pagination' => [ 'pageSize' => 10, ], /*
        $query->andWhere('node_status NOT IN (:DELETED, :DEACTIVATED, :WIPED)', [
            'DELETED' => self::STATUS_DELETED,
            'DEACTIVATED' => self::STATUS_DEACTIVATED,
            'WIPED' => self::STATUS_WIPED,
        ]);
        */ //$query->andWhere('node_ostype!=:node_ostype', ['node_ostype' => self::OSTYPE_WEBFM]); //$query->andFilterWhere(['node_status' => UserNode::STATUS_ACTIVE]); //$query->andWhere('node_status != :node_status', ['node_status' => UserNode::STATUS_DELETED]);