當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Listing::GetConditionSearchListing方法代碼示例

本文整理匯總了PHP中Listing::GetConditionSearchListing方法的典型用法代碼示例。如果您正苦於以下問題:PHP Listing::GetConditionSearchListing方法的具體用法?PHP Listing::GetConditionSearchListing怎麽用?PHP Listing::GetConditionSearchListing使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Listing的用法示例。


在下文中一共展示了Listing::GetConditionSearchListing方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: GetArrListingIdByPropertyName

 /**
  * @Author: ANH DUNG Dec 02, 2014
  * @Todo: get array listing id by property name
  * @Param: $property_name_or_address
  */
 public static function GetArrListingIdByPropertyName($property_name_or_address)
 {
     $criteria = new CDbCriteria();
     Listing::GetConditionSearchListing($criteria, $property_name_or_address);
     $models = Listing::model()->findAll($criteria);
     return CHtml::listData($models, "id", "id");
 }
開發者ID:jasonhai,項目名稱:onehome,代碼行數:12,代碼來源:Listing.php

示例2: actionSearchLandlordTenant

  * @Author: ANH DUNG Apr 24, 2014
  * @Todo: search autocomplete landlord and tenant at FE create new transaction
  */
 public function actionSearchLandlordTenant()
 {
     if (!isset($_GET['term']) || !Yii::app()->request->isAjaxRequest) {
         throw new CHttpException(404, "Invalid request");
     }
     $role = ROLE_LANDLORD;
     $aCheck = array(ROLE_LANDLORD, ROLE_TENANT);
     if (isset($_GET['role']) && in_array($_GET['role'], $aCheck)) {
         $role = $_GET['role'];
     }
     $criteria = new CDbCriteria();
     $criteria->compare(" t.role_id", $role);
     $criteria->addSearchCondition('CONCAT(t.first_name, " " ,t.last_name, " " ,t.nric_passportno_roc)', $_GET['term'], true);
     // true ==> LIKE '%...%'
     $criteria->limit = 30;
     $models = Users::model()->findAll($criteria);
     $returnVal = array();
     $cmsFormat = new CmsFormatter();
     foreach ($models as $model) {
         $label = $cmsFormat->formatFullNameRegisteredUsers($model);
         $returnVal[] = array('label' => $label, 'value' => $label, 'id' => $model->id, 'row_class_id' => "row_class_id{$model->id}", 'full_name' => $label, 'email' => $model->email_not_login, 'nric_passportno_roc' => $model->nric_passportno_roc, 'contact_no' => $model->contact_no, 'address' => $model->address, 'postal_code' => $model->postal_code, 'id_type' => $model->id_type, 'pass_expiry_date' => $cmsFormat->formatDatePickerInput($model->pass_expiry_date), 'upload_employment_pass_passport' => $model->upload_employment_pass_passport, 'scanned_passport' => $model->scanned_passport, 'postal_code' => $model->postal_code);
     }
     echo CJSON::encode($returnVal);
     Yii::app()->end();
 }
 /**
  * @Author: ANH DUNG Apr 24, 2014
  * @Todo: search autocomplete landlord and tenant at FE create new transaction
開發者ID:jasonhai,項目名稱:onehome,代碼行數:31,代碼來源:AjaxController.php


注:本文中的Listing::GetConditionSearchListing方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。