/** * Creates data provider instance with search query applied * * @param array $params * * @return ActiveDataProvider */ public function search($params) { $query = IndexSlide::find(); $dataProvider = new ActiveDataProvider(['query' => $query]); if (!($this->load($params) && $this->validate())) { return $dataProvider; } $query->andFilterWhere(['id' => $this->id, 'game_id' => $this->game_id, 'created_at' => $this->created_at, 'updated_at' => $this->updated_at, 'status' => $this->status, 'sort' => $this->sort]); $query->andFilterWhere(['like', 'name', $this->name])->andFilterWhere(['like', 'caption', $this->caption])->andFilterWhere(['like', 'description', $this->description])->andFilterWhere(['like', 'access_url', $this->access_url])->andFilterWhere(['like', 'official_url', $this->official_url])->andFilterWhere(['like', 'thumbnail_base_url', $this->thumbnail_base_url])->andFilterWhere(['like', 'thumbnail_path', $this->thumbnail_path]); return $dataProvider; }
public static function getActiveIndexSlide() { return IndexSlide::find()->where(['status' => IndexSlide::STATUS_IN_USE])->orderBy('sort ASC')->all(); }