本文整理汇总了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