当前位置: 首页>>代码示例>>PHP>>正文


PHP Apartment::getDependency方法代码示例

本文整理汇总了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;
开发者ID:alexjkitty,项目名称:estate,代码行数:67,代码来源:MainController.php


注:本文中的Apartment::getDependency方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。