本文整理汇总了PHP中Apartment::getDependency方法的典型用法代码示例。如果您正苦于以下问题:PHP Apartment::getDependency方法的具体用法?PHP Apartment::getDependency怎么用?PHP Apartment::getDependency使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Apartment
的用法示例。
在下文中一共展示了Apartment::getDependency方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: actionMainsearch
//.........这里部分代码省略.........
} else {
$sql = 'SELECT id
FROM {{apartment}}
WHERE MATCH
(title_' . Yii::app()->language . ', description_' . Yii::app()->language . ', description_near_' . Yii::app()->language . ', address_' . Yii::app()->language . ')
AGAINST ("*' . $term . '*" IN BOOLEAN MODE)';
}
$resTerm = Yii::app()->db->createCommand($sql)->queryAll();
if (is_array($resTerm) && count($resTerm) > 0) {
$resTerm = CHtml::listData($resTerm, 'id', 'relevance');
$criteria->addInCondition('t.id', array_keys($resTerm));
} else {
$criteria->addInCondition('t.id', array(0));
# ничего не найдено
}
}
}
// поиск объявлений владельца
$this->userListingId = Yii::app()->request->getParam('userListingId');
if ($this->userListingId) {
$criteria->addCondition('owner_id = :userListingId');
$criteria->params[':userListingId'] = $this->userListingId;
}
$filterName = null;
// Поиск по справочникам - клик в просмотре профиля анкеты
if (param('useReferenceLinkInView')) {
if (Yii::app()->request->getQuery('serviceId', false)) {
$serviceId = Yii::app()->request->getQuery('serviceId', false);
if ($serviceId) {
$serviceIdArray = explode('-', $serviceId);
if (is_array($serviceIdArray) && count($serviceIdArray) > 0) {
$value = (int) $serviceIdArray[0];
$sql = 'SELECT DISTINCT apartment_id FROM {{apartment_reference}} WHERE reference_value_id = ' . $value;
$apartmentIds = Yii::app()->db->cache(param('cachingTime', 1209600), Apartment::getDependency())->createCommand($sql)->queryColumn();
//$apartmentIds = Yii::app()->db->createCommand($sql)->queryColumn();
$criteria->addInCondition('t.id', $apartmentIds);
Yii::app()->getModule('referencevalues');
$sql = 'SELECT title_' . Yii::app()->language . ' FROM {{apartment_reference_values}} WHERE id = ' . $value;
$filterName = Yii::app()->db->cache(param('cachingTime', 1209600), ReferenceValues::getDependency())->createCommand($sql)->queryScalar();
if ($filterName) {
$filterName = CHtml::encode($filterName);
}
}
}
}
}
if (issetModule('formeditor')) {
$newFieldsAll = FormDesigner::getNewFields();
foreach ($newFieldsAll as $field) {
$value = CHtml::encode(Yii::app()->request->getParam($field->field));
if (!$value) {
continue;
}
$fieldString = $field->field;
$this->newFields[$fieldString] = $value;
switch ($field->compare_type) {
case FormDesigner::COMPARE_EQUAL:
$criteria->compare($fieldString, $value);
break;
case FormDesigner::COMPARE_LIKE:
$criteria->compare($fieldString, $value, true);
break;
case FormDesigner::COMPARE_FROM:
$value = intval($value);
$criteria->compare($fieldString, ">={$value}");
break;