本文整理匯總了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");
}
示例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