/** * */ public function actionSearch() { $model = new Deal('search'); $model->getDbCriteria()->with[] = 'negotiator'; $model->DIY = [Deal::DIY_NONE, Deal::DIY_DIY, Deal::DIY_DIT]; /** @var $user User */ $user = Yii::app()->user->getUserObject(); if (!isset($_GET['Deal'])) { if (!$model->dea_type) { $model->dea_type = [$user->use_scope]; } if (!$model->dea_status) { $model->dea_status = array(Deal::STATUS_AVAILABLE, Deal::STATUS_PRODUCTION, Deal::STATUS_PROOFING, Deal::STATUS_UNDER_OFFER, Deal::STATUS_UNDER_OFFER_WITH_OTHER); } } $this->render('search', ['model' => $model]); }