public function run()
 {
     Yii::import('application.modules.apartments.helpers.apartmentsHelper');
     $this->widgetTitle = tc('Special offers');
     $this->criteria = new CDbCriteria();
     $this->criteria->addCondition('is_special_offer = 1');
     $result = apartmentsHelper::getApartments(param('countListitng' . User::getModeListShow(), 6), $this->usePagination, 0, $this->criteria);
     if ($this->count) {
         $result['count'] = $this->count;
     }
     $this->render('widgetApartments_list', $result);
 }
 public function run()
 {
     Yii::import('application.modules.apartments.helpers.apartmentsHelper');
     $result = apartmentsHelper::getApartments(12, 0, 0, $this->criteria);
     if (!$this->breadcrumbs) {
         $this->breadcrumbs = array(Yii::t('common', 'Apartment search'));
     }
     if ($this->count) {
         $result['count'] = $this->count;
     } else {
         $result['count'] = $result['apCount'];
     }
     $this->render('widgetApartments_list_home', $result);
 }
Beispiel #3
0
 public function run()
 {
     Yii::import('application.modules.apartments.helpers.apartmentsHelper');
     $result = apartmentsHelper::getApartments(param('countListitng' . User::getModeListShow(), 10), $this->usePagination, 0, $this->criteria);
     if (!$this->breadcrumbs) {
         $this->breadcrumbs = array(Yii::t('common', 'Apartment search'));
     }
     if ($this->count) {
         $result['count'] = $this->count;
     } else {
         $result['count'] = $result['apCount'];
     }
     $this->render('widgetApartments_list', $result);
 }
Beispiel #4
0
 public function actionIndex()
 {
     Yii::import('application.modules.apartments.helpers.apartmentsHelper');
     Yii::app()->getModule('referencecategories');
     $criteria = new CDbCriteria();
     $criteria->addInCondition('t.id', Yii::app()->controller->apInComparison);
     $result = apartmentsHelper::getApartments(param('countListingsInComparisonList', 5), 0, 0, $criteria);
     $apartments = null;
     if (array_key_exists('criteria', $result)) {
         $apartments = Apartment::findAllWithCache($result['criteria']);
     }
     if (!$apartments) {
         $this->redirect(Yii::app()->controller->createAbsoluteUrl('/'));
     }
     $this->render('index', array('apartments' => $apartments));
 }
 public function run()
 {
     Yii::import('application.modules.apartments.helpers.apartmentsHelper');
     $dependency = new CDbCacheDependency('SELECT MAX(date_updated) FROM {{apartment}}');
     $sql = 'SELECT id FROM {{apartment}} WHERE active="' . Apartment::STATUS_ACTIVE . '" ';
     if (param('useUserads')) {
         $sql .= ' AND owner_active = ' . Apartment::STATUS_ACTIVE;
     }
     $results = Yii::app()->db->cache(param('cachingTime', 1209600), $dependency)->createCommand($sql)->queryColumn();
     shuffle($results);
     $this->criteria = new CDbCriteria();
     $this->criteria->addInCondition('t.id', array_slice($results, 0, param('countListitng' . User::getModeListShow(), 6)));
     $result = apartmentsHelper::getApartments(param('countListitng' . User::getModeListShow(), 6), $this->usePagination, 0, $this->criteria);
     if ($this->count) {
         $result['count'] = $this->count;
     }
     $this->render('widgetApartments_list', $result);
 }
 public function run()
 {
     Yii::import('application.modules.apartments.helpers.apartmentsHelper');
     $this->criteria = new CDbCriteria();
     if ($this->bt_param == 'latest-app-tb-left') {
         $this->criteria->addCondition('type = 3');
     } else {
         $this->criteria->addCondition('type = 4');
     }
     $result = apartmentsHelper::getApartments(param('countListitng' . User::getModeListShow(), 10), $this->usePagination, 0, $this->criteria);
     if (!$this->breadcrumbs) {
         $this->breadcrumbs = array(Yii::t('common', 'Apartment search'));
     }
     if ($this->count) {
         $result['count'] = $this->count;
     } else {
         $result['count'] = $result['apCount'];
     }
     $result['bt_param'] = $this->bt_param;
     $this->render('widgetApartments_list_Table', $result);
 }