public function actionSearch() { $this->checkRequest(); $q = $this->q; $this->checkRequiredParams($q, array('token', 'user_id', 'status', 'type', 'page')); $this->checkToken(); //same as login session $criteria = new CDbCriteria(); $criteria->compare('user_id', $q->user_id); $criteria->compare('status_listing', $q->status); $criteria->compare('listing_type', $q->type); $criteria->limit = 20; $criteria->order = 'property_name_or_address ASC'; $models = Listing::model()->findAll($criteria); $items = array(); foreach ($models as $model) { $items[] = array('property_name_or_address' => $model->property_name_or_address, 'tenure' => Listing::getViewDetailTenure($model)); } $result = ApiModule::$defaultSuccessResponse; $result['list'] = $items; $result['message'] = Yii::t('systemmsg', 'Query success'); //always need ApiModule::sendResponse($result); }
</div> <div class="col-sm-6"> <ul class="list-unstyled"> <li><span><?php echo $model->getAttributeLabel('furnished'); ?> :</span><strong><?php echo $model->rFurnished ? $model->rFurnished->name : ''; ?> </strong></li> <li><span>Developer:</span><strong><?php echo $model->developer; ?> </strong></li> <li><span>Tenure:</span> <strong><?php echo Listing::getViewDetailTenure($model); ?> </strong></li> <?php if ($model->listing_type == Listing::FOR_RENT) { ?> <?php if ($model->rLeaseTerm) { ?> <li><span>Lease Term:</span><strong><?php echo $model->rLeaseTerm->name; ?> </strong></li> <?php }