/** * Creates data provider instance with search query applied * * @param array $params * * @return ActiveDataProvider */ public function search($params) { $query = PlayerAlbum::find(); $dataProvider = new ActiveDataProvider(['query' => $query]); if (!($this->load($params) && $this->validate())) { return $dataProvider; } $query->andFilterWhere(['id' => $this->id, 'created_at' => $this->created_at, 'updated_at' => $this->updated_at, 'status' => $this->status]); $query->andFilterWhere(['like', 'thumbnail_base_url', $this->thumbnail_base_url])->andFilterWhere(['like', 'thumbnail_path', $this->thumbnail_path])->andFilterWhere(['like', 'url', $this->url]); return $dataProvider; }
public static function getStatusInUsePlayerAlbum() { return PlayerAlbum::find()->where(['status' => PlayerAlbum::STATUS_IN_USE])->orderBy('updated_at DESC')->all(); }