Search model object

@param array $params Query params
@return array
13491
public function search($params = array()) {
        $this->checkPermissions('search');
        
        return $this->client->retrieveData($this->resourceName . '/search', $params);
    }
1220823
public function search($params)
    {
        $searchResult = $this->getRequest()->request(
            'POST',
            $this->getRequestUrl('searches'),
            $this->getSearchQuery($params)
        );

        return $this->getInputsFromSearchResult($searchResult);
    }
519651
public function search($params)
    {
        $query = Comment::find();

        $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;
        }

        $query->andFilterWhere([
            'id' => $this->id,
            'obj_id' => $this->obj_id,
            'parent' => $this->parent,
            'author' => $this->author,
            'created_at' => $this->created_at,
            'updated_at' => $this->updated_at,
            'created_by' => $this->created_by,
            'updated_by' => $this->updated_by,
        ]);

        $query->andFilterWhere(['like', 'content', $this->content])
            ->andFilterWhere(['like', 'author_name', $this->author_name])
            ->andFilterWhere(['like', 'author_email', $this->author_email])
            ->andFilterWhere(['like', 'author_url', $this->author_url])
            ->andFilterWhere(['like', 'author_ip', $this->author_ip])
            ->andFilterWhere(['like', 'status', $this->status])
            ->andFilterWhere(['like', 'type', $this->type])
            ->andFilterWhere(['like', 'obj_type', $this->obj_type]);

        return $dataProvider;
    }
1063134
public function search($params)
    {
        $this->load($params);
        $query = NutsLocation::find();

        $query->where(['country_id'=>$this->country_id,'postcode'=>$this->postcode,]);

        $this->pageSize = 1;

        $dataProvider = new ActiveDataProvider([
            'query' => $query,
            'pagination' => ($this->pagination ? [
                'pageSize' => $this->pageSize,
                    ] : FALSE),
            'sort' => [
                'attributes' => [
                    'postcode'
                ],
            ]
        ]);



        return $dataProvider;
    }
1098876
public function search($params = [])
    {
        $query = Server::find();

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

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

        $query->andFilterWhere([
            'osimage' => $this->osimage,
            'livecd'  => $this->livecd,
        ]);

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

        $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;
        }

        $query->andFilterWhere([
            'id' => $this->id,
            'material' => $this->material,
            'created_at' => $this->created_at,
            'updated_at' => $this->updated_at,
        ]);

        $query->andFilterWhere(['like', 'mediaId', $this->mediaId])
            ->andFilterWhere(['like', 'post', $this->post])
            ->andFilterWhere(['like', 'result', $this->result])
            ->andFilterWhere(['like', 'type', $this->type]);

        return $dataProvider;
    }
363949
public function search($params)
    {
        $query = Attachment::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,
            'size' => $this->size,
            'created_at' => $this->created_at,
        ]);

        $query->andFilterWhere(['like', 'filename', $this->filename])
            ->andFilterWhere(['like', 'original_name', $this->original_name])
            ->andFilterWhere(['like', 'type', $this->type])
            ->andFilterWhere(['like', 'path', $this->path])
            ->andFilterWhere(['like', 'ip', $this->ip]);

        return $dataProvider;
    }
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;
    }
1082628
public function search($params)
    {
        $subquery = (new Query())
                    ->select(['m2.replyto'])
                    ->from(['m1' => Message::tableName()])
                    ->leftJoin(['m2' => Message::tableName()], 'm1.replyto = m2.id')
                    ->where(['is not', 'm2.replyto', null]);
        $query = static::find()->where(['and',
            ['receiver_id' => User::loggedId()],
            ['!=', 'receiver_status', self::STATUS_DELETED],
            ['not in', 'message_id', $subquery]
        ]);
        $dataProvider = new ActiveDataProvider([
            'query' => $query,
        ]);
        $dataProvider->sort->attributes['senderName'] = [
            'asc' => [
                User::tableName() . '.username' => SORT_ASC,
                User::tableName() . '.id' => SORT_ASC
            ],
            'desc' => [
                User::tableName() . '.username' => SORT_DESC,
                User::tableName() . '.id' => SORT_DESC
            ],
            'default' => SORT_ASC
        ];
        $dataProvider->sort->defaultOrder = ['id' => SORT_DESC];
        $dataProvider->pagination->pageSize = Yii::$app->session->get('per-page', 20);

        if (!($this->load($params) && $this->validate())) {
            $dataProvider->query->joinWith(['message' => function ($q) {
                $q->joinWith(['sender']);
            }]);
            return $dataProvider;
        }

        $dataProvider->query->andFilterWhere(['like', 'topic', $this->topic]);

        if (preg_match('/^(forum|orum|rum|um|m)?#([0-9]+)$/', strtolower($this->senderName), $matches)) {
            $dataProvider->query->joinWith(['message' => function ($q) use ($matches) {
                $q->joinWith(['sender' => function ($q) use ($matches) {
                    $q->andFilterWhere(['and',
                        [User::tableName() . '.id' => $matches[2]],
                        ['or',
                            ['username' => ''],
                            ['username' => null]
                        ]
                    ]);
                }]);
            }]);
        } elseif (preg_match('/^([0-9]+)$/', $this->senderName, $matches)) {
            $dataProvider->query->joinWith(['message' => function ($q) use ($matches) {
                $q->joinWith(['sender' => function ($q) use ($matches) {
                    $q->andFilterWhere(['or',
                        ['like', 'username', $this->senderName],
                        ['and',
                            ['id' => $matches[1]],
                            ['or',
                                ['username' => ''],
                                ['username' => null]
                            ]
                        ],
                    ]);
                }]);
            }]);
        } else {
            $dataProvider->query->joinWith(['message' => function ($q) {
                $q->joinWith(['sender' => function ($q) {
                    $q->andFilterWhere(['like', User::tableName() . '.username', $this->senderName]);
                }]);
            }]);
        }
        return $dataProvider;
    }
743831
public function search($params)
    {
        $query = Lang::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,
            'default' => $this->default,
            'date_update' => $this->date_update,
            'date_create' => $this->date_create,
        ]);

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

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

        $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;
        }

        $query->andFilterWhere([
            'id' => $this->id,
            'wid' => $this->wid,
            'status' => $this->status,
            'priority' => $this->priority,
            'created_at' => $this->created_at,
            'updated_at' => $this->updated_at,
        ]);

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

        return $dataProvider;
    }
1084031
public function search($params)
    {
        $query = static::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,
            'pid' => $this->pid,
            'sort_order' => $this->sort_order,
            'status' => $this->status,
        ]);

        $query->andFilterWhere(['like', 'label', $this->label])
            ->andFilterWhere(['like', 'url', $this->url])
            ->andFilterWhere(['like', 'content', $this->content]);

        return $dataProvider;
    }
1355539
public function search($params) {
        $query = self::find();
        $dataProvider = new \yii\data\ActiveDataProvider([
            'query' => $query,
            'pagination' => [
                'pageSize' => 100,
            ],
            'sort' => [
                'defaultOrder' => [
                    'code' => SORT_DESC
                ]
            ]
        ]);
        if ($this->load($params) && $this->validate()) {
            $query->andFilterWhere(['like', 'code', $this->code]);
            $query->andFilterWhere(['like', 'name', $this->name]);
            $query->andFilterWhere(['is_active' => $this->is_active]);
        }
        return $dataProvider;
    }
659123
public function search($params)
    {
        $query = Seo::find();
        $dataProvider = new ActiveDataProvider([
            'query' => $query,
            'sort' => [
                'defaultOrder' => ['id' => SORT_DESC],
            ],
        ]);
        $this->load($params);
        if (!$this->validate()) {
            return $dataProvider;
        }
        $query->andFilterWhere([
            Seo::tableName() . '.id' => $this->id,
        ])->andFilterWhere(['LIKE', Seo::tableName() . '.title', $this->title])
            ->andFilterWhere(['LIKE', Seo::tableName() . '.description', $this->description]);
        return $dataProvider;
    }
1138281
public function search($params)
    {
        $query = WarehouseProduct::find();

        $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;
        }

        $query->andFilterWhere([
            'id' => $this->id,
            'name' => $this->name,
            'created_at' => $this->created_at,
            'updated_at' => $this->updated_at,
            'created_by' => $this->created_by,
            'updated_by' => $this->updated_by,
        ]);

        $query->andFilterWhere(['like', 'feature_img', $this->feature_img])
            ->andFilterWhere(['like', 'sku', $this->sku])
            ->andFilterWhere(['like', 'description', $this->description]);

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

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

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

        $query->andFilterWhere(
            [
                'id' => $this->id,
                'type' => $this->type,
                'nested' => $this->nested,
                'status_id' => $this->status_id,
                'FROM_UNIXTIME(created_at, "%d.%m.%Y")' => $this->created_at,
                'FROM_UNIXTIME(updated_at, "%d.%m.%Y")' => $this->updated_at
            ]
        );

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

        if ($this->title) {
            $query->andFilterWhere(['like', 'title', $this->title]);
        }

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

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

        $this->load($params);

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

        $query->andFilterWhere([
            'id' => $this->id,
            'creation_time' => $this->creation_time,
            'ip' => $this->ip,
            'user_id' => $this->user_id,
        ]);

        $query->andFilterWhere(['like', 'module', $this->module]);
        $query->andFilterWhere(['like', 'controller', $this->controller]);
        $query->andFilterWhere(['like', 'action', $this->action]);

        return $dataProvider;
    }