public function actionMyAdverts() { if (Currency::find()->where(['>', 'date', time()])->orderBy(['date' => SORT_DESC])->asArray()->one() == null) { $currency = new Currency(); if ($currency->exchangeRates()) { Yii::$app->session->setFlash('warning', 'Exchange rates might differ from actual ones'); } } $searchModel = new AdvertSearch(); $dataProvider = $searchModel->getMyAdverts(); return $this->render('my-adverts', ['searchModel' => $searchModel, 'dataProvider' => $dataProvider]); }
public function actionMyAdverts() { $searchModel = new AdvertSearch(); $dataProvider = $searchModel->getMyAdverts(); return $this->render('my-adverts', ['searchModel' => $searchModel, 'dataProvider' => $dataProvider]); }