[ 'class' => 'yii\web\ErrorAction', ], 'captcha' => [ 'class' => 'yii\captcha\CaptchaAction', 'fixedVerifyCode' => YII_ENV_TEST ? 'testme' : NULL, ], ]; } public function actionProject() { $projects = new ActiveDataProvider([ 'query' => Project::find(), 'pagination' => [ 'pageSize' => 9, ], ]); return $this->render('project', [ 'projects' => $projects, ]); } public function actionCustomer() { $model = new CustomerSearch(); $dataProvider = $model->search(Yii::$app->request->queryParams); $dataProvider->setPagination([ 'pageSize' => 5, ]); $dataProvider->setSort([ 'defaultOrder' => [ 'name' => SORT_ASC, ], 'attributes' => [ 'name' => [ 'asc' => [ 'company_info.name' => SORT_ASC, 'firstname' => SORT_ASC, 'lastname' => SORT_ASC, ], 'desc' => [ 'company_info.name' => SORT_DESC, 'firstname' => SORT_DESC, 'lastname' => SORT_DESC, ], 'default' => SORT_ASC, 'label' => 'Название', ], 'staff' => [ 'asc' => [ 'company_info.staff' => SORT_ASC, ], 'desc' => [ 'company_info.staff' => SORT_DESC, ], 'default' => SORT_DESC, 'label' => 'Количество сотрудников', ], 'visit' => [ 'asc' => [ 'user_info.date_visit' => SORT_ASC, ], 'desc' => [ 'user_info.date_visit' => SORT_DESC, ], 'default' => SORT_DESC, 'label' => 'Последний визит', ], 'city' => [ 'asc' => [ 'user_info.city' => SORT_ASC, ], 'desc' => [ 'user_info.city' => SORT_DESC, ], 'default' => SORT_ASC, 'label' => 'Город', ], ], ]); $model->load(Yii::$app->request->queryParams); return $this->render('customer', [ 'model' => $model, 'dataProvider' => $dataProvider, ]); } public function actionPerformer() { $specializationArray = []; $specialization = Specialization::find()->where(['specialization_id'=> Specialization::find()->select('specialization_id') ->andWhere('specialization_pid != 0') ->column()]) ->all(); foreach(ArrayHelper::index($specialization,'specialization_id') as $spec){ $array = $spec->hasChildrenInArray($specialization); if($array){ $specializationArray[$spec->specialization_name] = $array; } } $searchModel = new SearchPerformerForm(); return $this->render('performer',[ 'dataProvider' => $searchModel->search(Yii::$app->request->queryParams), 'specialization' => $specializationArray, 'model'=> $searchModel ]); } public function actionVacancy() { $query = Vacancy::find(); $countQuery = clone $query; $pagination = new Pagination([ 'totalCount' => $countQuery->count(), 'pageSize' => 15, ]); $vacancy = $query->offset($pagination->offset) ->limit($pagination->limit); $provider = new ActiveDataProvider([ 'query' => $vacancy, 'pagination' => false, 'sort' => [ 'defaultOrder' => [ 'date_add' => SORT_DESC, 'name' => SORT_ASC, ], ], ]); return $this->render('vacancy', [ 'provider' => $provider, 'pagination' => $pagination, ]); } }