示例#1
0
 public function actionAdmin()
 {
     $countNewsProduct = NewsProduct::getCountNoShow();
     if ($countNewsProduct > 0) {
         Yii::app()->user->setFlash('info', Yii::t('common', 'There are new product news') . ': ' . CHtml::link(Yii::t('common', '{n} news', $countNewsProduct), array('/news/backend/main/product')));
     }
     $this->rememberPage();
     $this->getMaxSorter();
     $this->getMinSorter();
     $model = new Apartment('search');
     $model->resetScope();
     $model->unsetAttributes();
     // clear any default values
     if (isset($_GET[$this->modelName])) {
         $model->attributes = $_GET[$this->modelName];
     }
     $model->setRememberScenario('ads_remember');
     $model = $model->with(array('user'));
     $this->params['paidServicesArray'] = array();
     if (issetModule('paidservices')) {
         $paidServices = PaidServices::model()->findAll('id != ' . PaidServices::ID_ADD_FUNDS);
         $this->params['paidServicesArray'] = CHtml::listData($paidServices, 'id', 'name');
     }
     $this->render('admin', array_merge(array('model' => $model), $this->params));
 }