/** * Lists all Question models. * @return mixed */ public function actionIndex() { if (Yii::$app->user->isGuest) { return $this->redirect(['site/login']); } if (!\Yii::$app->user->can('7progress')) { return $this->goBack(); // goHome } User::checkQ(); $searchModel = new SearchQuestion(); $dataProvider = $searchModel->allPotenc(Yii::$app->request->queryParams); $dataProvider1 = $searchModel->allDo(Yii::$app->request->queryParams); //$dataProvider1->andFilterWhere(['like', 'user_take', '0']); //->andFilterWhere(['like', 'tbl_country.name', $this->country]); return $this->render('index', ['searchModel' => $searchModel, 'dataProvider' => $dataProvider, 'dataProvider1' => $dataProvider1, 'countOwnQ' => Question::find()->where(['user_created' => Yii::$app->user->id, 'npp' => 0])->count()]); }
/** * Lists all Question models. * @return mixed */ public function actionIndex() { $searchModel = new SearchQuestion(); $dataProvider = $searchModel->search(Yii::$app->request->queryParams); return $this->render('index', ['dataProvider' => $dataProvider, 'searchModel' => $searchModel]); }