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


PHP QueryGenerator::parseAdvFilterList方法代码示例

本文整理汇总了PHP中QueryGenerator::parseAdvFilterList方法的典型用法代码示例。如果您正苦于以下问题:PHP QueryGenerator::parseAdvFilterList方法的具体用法?PHP QueryGenerator::parseAdvFilterList怎么用?PHP QueryGenerator::parseAdvFilterList使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在QueryGenerator的用法示例。


在下文中一共展示了QueryGenerator::parseAdvFilterList方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: getRelationQuery

 /**
  * Function to get Relation query
  * @return <String>
  */
 public function getRelationQuery()
 {
     $relationModel = $this->getRelationModel();
     if (!empty($relationModel) && $relationModel->get('name') != NULL) {
         $recordModel = $this->getParentRecordModel();
         $query = $relationModel->getQuery($recordModel, false, $this);
         return $query;
     }
     $searchParams = $this->get('search_params');
     if (empty($searchParams)) {
         $searchParams = array();
     }
     $relatedModuleModel = $this->getRelatedModuleModel();
     $relatedModuleName = $relatedModuleModel->getName();
     $relatedModuleBaseTable = $relatedModuleModel->basetable;
     $relatedModuleEntityIdField = $relatedModuleModel->basetableid;
     $parentModuleModel = $relationModel->getParentModuleModel();
     $parentModuleBaseTable = $parentModuleModel->basetable;
     $parentModuleEntityIdField = $parentModuleModel->basetableid;
     $parentRecordId = $this->getParentRecordModel()->getId();
     $parentModuleDirectRelatedField = $parentModuleModel->get('directRelatedFieldName');
     $relatedModuleFields = array_keys($this->getHeaders());
     $currentUserModel = Users_Record_Model::getCurrentUserModel();
     $queryGenerator = new QueryGenerator($relatedModuleName, $currentUserModel);
     $queryGenerator->setFields($relatedModuleFields);
     if (count($searchParams) > 0) {
         $queryGenerator->parseAdvFilterList($searchParams);
     }
     $joinQuery = ' INNER JOIN ' . $parentModuleBaseTable . ' ON ' . $parentModuleBaseTable . '.' . $parentModuleDirectRelatedField . " = " . $relatedModuleBaseTable . '.' . $relatedModuleEntityIdField;
     $query = $queryGenerator->getQuery();
     $queryComponents = spliti(' FROM ', $query);
     foreach ($queryComponents as $key => $val) {
         if ($key == 0) {
             $query = $queryComponents[0] . ' ,vtiger_crmentity.crmid';
         } else {
             $query .= ' FROM ' . $val;
         }
     }
     $whereSplitQueryComponents = spliti(' WHERE ', $query);
     $query = $whereSplitQueryComponents[0] . $joinQuery;
     foreach ($whereSplitQueryComponents as $key => $val) {
         if ($key == 0) {
             $query .= " WHERE {$parentModuleBaseTable}.{$parentModuleEntityIdField} = {$parentRecordId} AND ";
         } else {
             $query .= $val . ' WHERE ';
         }
     }
     $query = trim($query, "WHERE ");
     return $query;
 }
开发者ID:vinzdrance,项目名称:YetiForceCRM,代码行数:54,代码来源:RelationListView.php

示例2: addSearchConditions

 public function addSearchConditions($query, $searchParams, $related_module)
 {
     if (!empty($searchParams)) {
         $currentUserModel = Users_Record_Model::getCurrentUserModel();
         $queryGenerator = new QueryGenerator($related_module, $currentUserModel);
         $queryGenerator->parseAdvFilterList($searchParams);
         $where = $queryGenerator->getWhereClause(true);
         $query .= $where;
     }
     return $query;
 }
开发者ID:noclav,项目名称:UpdatePackages,代码行数:11,代码来源:Relation.php


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