Get IDS filter

@param $params
@return array|null
15978
public function itemsFilterIds($params) {
		//
		$cacheenabled = (!empty($params['cacheenabled']));
		if ($cacheenabled) {
			$bcache = \Brilliant\BFactory::GetCache();
		}
		if ($bcache) {
			$hash = $this->itemsFilterHash($params);
			$ids = $bcache->get($hash);
			if (($ids !== false) && ($ids !== NULL)) {
				return $ids;
			}
		}
		//
		if (!$db = $this->getDBO()) {
			return false;
		}
		if (is_array($this->primaryKeyName)) {
			$flds = array();
			foreach ($this->primaryKeyName as $pk) {
				$flds[] = '`' . $this->tableName . '`.`' . $pk . '`';
			}
			$qr = 'select ' . implode(',', $flds) . ' from `' . $this->tableName . '`';
		} else {
			$qr = 'select `' . $this->tableName . '`.`' . $this->primaryKeyName . '` from `' . $this->tableName . '`';
		}
		$this->itemsFilterSql($params, $wh, $jn);
		if (!empty($jn)) {
			$qr .= ' ' . implode(' ', $jn);
		}
		if (!empty($wh)) {
			$qr .= ' WHERE (' . implode(' AND ', $wh) . ')';
		}
		if (isset($params['orderby'])) {
			$orderasc = isset($params['orderdir']) ? ' ' . $params['orderdir'] : '';
			if ($params['orderby'] == "RAND()") {
				$qr .= ' ORDER BY ' . $params['orderby'] . '' . $orderasc;
			} else {
				$qr .= ' ORDER BY `' . $params['orderby'] . '`' . $orderasc;
			}
		}
		//Limit & offset
		if (!empty($params['limit'])) {
			$limit = (int)$params['limit'];
			$offset = (int)$params['offset'];
			$qr .= ' LIMIT ' . $limit;
			if ($offset) {
				$qr .= ' OFFSET ' . $offset;
			}
		}
		//Execute query
		$q = $db->Query($qr);
		if (empty($q)) {
			return false;
		}
		$ids = array();
		while ($l = $db->fetch($q)) {
			if (is_array($this->primaryKeyName)) {
				$id = array();
				foreach ($this->primaryKeyName as $pk) {
					$id[$pk] = $l[$pk];
				}
			} else {
				$id = (int)$l[$this->primaryKeyName];
			}
			$ids[] = $id;
		}
		//
		if ($bcache) {
			$bcache->set($hash, $ids, $this->cacheTime);
		}
		//
		return $ids;
	}
141269
public function search($params)
    {
        $query = ShopAttributeValue::find()->where(['attribute_id' => $params['attrId']]);

        // add conditions that should always apply here

        $dataProvider = new ActiveDataProvider([
            'query' => $query,
        ]);

        $this->load($params);

        if (!$this->validate()) {
            // uncomment the following line if you do not want to return any records when validation fails
            // $query->where('0=1');
            return $dataProvider;
        }

        // grid filtering conditions
        $query->andFilterWhere([
            'id' => $this->id,
            'attribute_id' => $this->attribute_id,
        ]);

//        $query->andFilterWhere(['like', 'value', $this->value]);

        return $dataProvider;
    }
1152679
public function findByIds($ids)
    {
        if (!is_array($ids)) {
            $ids = explode(',', $ids);
        }

        if (!$ids) {
            return [];
        }

        return $this->createValuedQueryBuilder('c')
            ->andWhere('c.id IN (:ids)')->setParameter('ids', $ids)
            ->andWhere('c.deletedAt IS NULL')
            ->andWhere('c.active = :active')
            ->andWhere('c.layout = :layout')
            ->andWhere('c.publishAt < :now OR c.publishAt IS NULL')->setParameter('now', new \DateTime())
            ->setParameter('active', true)
            ->setParameter('layout', false)
            ->getQuery()
            ->useResultCache(true, self::CACHE_TTL)
            ->getResult();
    }
761992
public function getQuery($queryParams)
    {
        return array_key_exists($queryParams, $this->query) ? $this->query[$queryParams] : null;
    }
50968
public function search($params)
    {
        $query = FilterType::find();

        // add conditions that should always apply here

        $dataProvider = new ActiveDataProvider([
            'query' => $query,
        ]);

        $this->load($params);

        if (!$this->validate()) {
            // uncomment the following line if you do not want to return any records when validation fails
            // $query->where('0=1');
            return $dataProvider;
        }

        // grid filtering conditions
        $query->andFilterWhere([
            'id' => $this->id,
        ]);

        $query->andFilterWhere(['like', 'class_name', $this->class_name])
            ->andFilterWhere(['like', 'column', $this->column])
            ->andFilterWhere(['like', 'displaying_column', $this->displaying_column])
            ->andFilterWhere(['like', 'title', $this->title]);

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

        // add conditions that should always apply here

        $dataProvider = new ActiveDataProvider([
            'query' => $query,
        ]);

        $this->load($params);

        if (!$this->validate()) {
            // uncomment the following line if you do not want to return any records when validation fails
            // $query->where('0=1');
            return $dataProvider;
        }

        // grid filtering conditions
        $query->andFilterWhere([
            'id' => $this->id,
            'user_id' => $this->user_id,
            'domain_id' => $this->domain_id,
            'created_at' => $this->created_at,
            'updated_at' => $this->updated_at,
        ]);

        $query->andFilterWhere(['like', 'name', $this->name])
            ->andFilterWhere(['like', 'json_value', $this->json_value]);

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

        // add conditions that should always apply here

        $dataProvider = new ActiveDataProvider([
            'query' => $query,
        ]);

        $this->load($params);

        if (!$this->validate()) {
            // uncomment the following line if you do not want to return any records when validation fails
            // $query->where('0=1');
            return $dataProvider;
        }

        // grid filtering conditions
        $query->andFilterWhere([
            'id' => $this->id,
            'service1_id' => $this->service1_id,
            'item1_id' => $this->item1_id,
            'service2_id' => $this->service2_id,
            'item2_id' => $this->item2_id,
            'relation_type' => $this->relation_type,
            'sort_order' => $this->sort_order,
            'status' => $this->status,
            'update_time' => $this->update_time,
            'creation_time' => $this->creation_time,
        ]);

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

        $query->orderBy(['id' => SORT_DESC]);

        $dataProvider = new ActiveDataProvider([
            'query' => $query,
        ]);

        $this->load($params);

        if (!$this->validate()) {
            // uncomment the following line if you do not want to return any records when validation fails
            // $query->where('0=1');
            return $dataProvider;
        }

        // grid filtering conditions
        $query->andFilterWhere([
            'id' => $this->id,
            'user_id' => $this->user_id,
            'folder_id' => $this->folder_id,
            'type' => $this->type,
            'size' => $this->size,
            'views' => $this->views,
            'expired_at' => $this->expired_at,
            'created_at' => $this->created_at,
            'updated_at' => $this->updated_at,
        ]);

        $query->andFilterWhere(['like', 'uuid', $this->uuid])
            ->andFilterWhere(['like', 'title', $this->title])
            ->andFilterWhere(['like', 'format', $this->format])
            ->andFilterWhere(['like', 'content', $this->content])
            ->andFilterWhere(['like', 'ip', $this->ip]);

        return $dataProvider;
    }
1145169
public function search($params)
    {
        $query = Article::find()->where(['user_id' => Yii::$app->user->id]);

        // add conditions that should always apply here

        $dataProvider = new ActiveDataProvider([
            'query' => $query,
        ]);

        $this->load($params);

        if (!$this->validate()) {
            // uncomment the following line if you do not want to return any records when validation fails
            // $query->where('0=1');
            return $dataProvider;
        }

        // grid filtering conditions
        $query->andFilterWhere([

            'status' => $this->status,
            'comments' => $this->comments,
            'supports' => $this->supports,
            'collections' => $this->collections,
            'views' => $this->views,
            'is_top' => $this->is_top,
            'is_best' => $this->is_best,
        ]);

        $query->andFilterWhere(['like', 'uuid', $this->uuid])
            ->andFilterWhere(['like', 'category_id', $this->category_id])
            ->andFilterWhere(['like', 'title', $this->title])
            ->andFilterWhere(['like', 'sub_title', $this->sub_title]);

        return $dataProvider;
    }
1003271
private function getIds(
        $collection = null,
        $systemCollections = true,
        $types = null,
        $search = null,
        $orderBy = null,
        $orderSort = null,
        $limit = null,
        $offset = null
    ) {
        $subQuery = $this->getIdsQuery(
            $collection,
            $systemCollections,
            $types,
            $search,
            $orderBy,
            $orderSort,
            $limit,
            $offset
        );

        return $subQuery->getScalarResult();
    }
627672
public function search($params)
    {
        $query = Z1User::find();

        // add conditions that should always apply here

        $dataProvider = new ActiveDataProvider([
            'query' => $query,
            'pagination' => [
                'pageSize' => 10,
            ],
            'sort' => [
                'defaultOrder' => [
                    'id' => SORT_DESC
                ],
            ],
        ]);

        $this->load($params);

        if (!$this->validate()) {
            // uncomment the following line if you do not want to return any records when validation fails
            // $query->where('0=1');
            return $dataProvider;
        }

        // grid filtering conditions
        $query->andFilterWhere([
            'id' => $this->id,
            'status' => $this->status,
            'created_at' => $this->created_at,
            'updated_at' => $this->updated_at,
        ]);

        $query->andFilterWhere(['like', 'username', $this->username])
            ->andFilterWhere(['like', 'auth_key', $this->auth_key])
            ->andFilterWhere(['like', 'password_hash', $this->password_hash])
            ->andFilterWhere(['like', 'password_reset_token', $this->password_reset_token])
            ->andFilterWhere(['like', 'email', $this->email]);

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

        $dataProvider = new ActiveDataProvider([
            'query' => $query,
        ]);

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

        $query->andFilterWhere([
            'id' => $this->id,
            'show_category' => $this->show_category,
        ]);

        $query->andFilterWhere(['like', 'title', $this->title])
            ->andFilterWhere(['like', 'alias', $this->alias]);

        return $dataProvider;
    }
670407
public function search($params)
    {
        $query = Category::find();
        $query->orderBy('position DESC, title');

        $dataProvider = new ActiveDataProvider([
            'query' => $query,
        ]);

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

        $query->andFilterWhere([
            'id' => $this->id,
            'parent_id' => $this->parent_id,
            'position' => $this->position,
        ]);

        $query->andFilterWhere(['like', 'title', $this->title])
            ->andFilterWhere(['like', 'alias', $this->alias]);

        return $dataProvider;
    }
216675
public function findByIds($ids)
    {
        $query = $this->createQueryBuilder('m')
            ->where('m.id IN (:ids)')
            ->andWhere('m.status = :status')
            ->setParameters(array(
                'ids' => $ids,
                'status' => 1,
            ))
            ->getQuery()
        ;

        return $query->getResult();
    }
1099690
public function search($params)
    {
        $query = SeoNotFound::find();

        // add conditions that should always apply here

        $dataProvider = new ActiveDataProvider([
            'query' => $query,
            'sort' => [
                'defaultOrder' => ['id' => SORT_DESC],
            ],
        ]);

        $this->load($params);

        if (!$this->validate()) {
            // uncomment the following line if you do not want to return any records when validation fails
            // $query->where('0=1');
            return $dataProvider;
        }

        // grid filtering conditions
        $query->andFilterWhere([
            'id' => $this->id,
            'created_at' => $this->created_at,
        ]);

        $query->andFilterWhere(['like', 'url', $this->url])
            ->andFilterWhere(['like', 'referrer', $this->referrer])
            ->andFilterWhere(['like', 'ip', $this->ip]);

        return $dataProvider;
    }
591001
private function retrieveFilter(Request $request)
    {
        $filter = [];
        $ids = $request->get('ids');

        if ($ids) {
            if (is_string($ids)) {
                $ids = explode(',', $ids);
            }

            $filter['id'] = $ids;
        }

        return $filter;
    }
177989
public function search($params)
    {
        $query = UrlRule::find();

        // add conditions that should always apply here

        $dataProvider = new ActiveDataProvider([
            'query' => $query,
        ]);

        $this->load($params);

        if (!$this->validate()) {
            // uncomment the following line if you do not want to return any records when validation fails
            // $query->where('0=1');
            return $dataProvider;
        }

        // grid filtering conditions
        $query->andFilterWhere([
            'id' => $this->id,
            'redirect' => $this->redirect,
            'redirect_code' => $this->redirect_code,
            'status' => $this->status,
        ]);

        $query->andFilterWhere(['like', 'slug', $this->slug])
            ->andFilterWhere(['like', 'route', $this->route])
            ->andFilterWhere(['like', 'params', $this->params]);

        return $dataProvider;
    }