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


PHP AssetModel::GenerateSearchSql方法代码示例

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


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

示例1: LoadArrayBySearch

    public static function LoadArrayBySearch($intCategoryId = null, $intManufacturerId = null, $strDescription = null, $strAssetModelCode = null, $arrCustomFields = null, $strDateModified = null, $strDateModifiedFirst = null, $strDateModifiedLast = null, $blnAttachment = null, $strOrderBy = null, $strLimit = null, $objExpansionMap = null)
    {
        AssetModel::ArrayQueryHelper($strOrderBy, $strLimit, $strLimitPrefix, $strLimitSuffix, $strExpandSelect, $strExpandFrom, $objExpansionMap, $objDatabase);
        // Setup QueryExpansion
        $objQueryExpansion = new QQueryExpansion();
        if ($objExpansionMap) {
            try {
                AssetModel::ExpandQuery('asset_model', null, $objExpansionMap, $objQueryExpansion);
            } catch (QCallerException $objExc) {
                $objExc->IncrementOffset();
                throw $objExc;
            }
        }
        $arrSearchSql = AssetModel::GenerateSearchSql($intCategoryId, $intManufacturerId, $strDescription, $strAssetModelCode, $arrCustomFields, $strDateModified, $strDateModifiedFirst, $strDateModifiedLast, $blnAttachment);
        $arrCustomFieldSql = CustomField::GenerateSql(EntityQtype::AssetModel);
        $arrAttachmentSql = Attachment::GenerateSql(EntityQtype::AssetModel);
        $strQuery = sprintf('
				SELECT
					%s
					COUNT( `asset`.`asset_id`) AS asset_count,
					`asset_model`.`asset_model_id` AS `asset_model_id`,
					`asset_model`.`category_id` AS `category_id`,
					`asset_model`.`manufacturer_id` AS `manufacturer_id`,
					`asset_model`.`asset_model_code` AS `asset_model_code`,
					`asset_model`.`short_description` AS `short_description`,
					`asset_model`.`long_description` AS `long_description`,
					`asset_model`.`image_path` AS `image_path`,
					`asset_model`.`created_by` AS `created_by`,
					`asset_model`.`creation_date` AS `creation_date`,
					`asset_model`.`modified_by` AS `modified_by`,
					`asset_model`.`modified_date` AS `modified_date`
					%s
					%s
					%s
				FROM
					`asset_model` AS `asset_model`
					LEFT JOIN `asset` AS `asset` ON `asset_model`.`asset_model_id` = `asset`.`asset_model_id` AND `asset`.`location_id` != 2 AND `asset`.`location_id` != 5
					%s
					%s
					%s
				WHERE
				1=1
				%s
				%s
				%s
				%s
				%s
				%s
				%s
				%s
				%s
				%s
			', $strLimitPrefix, $objQueryExpansion->GetSelectSql(",\n\t\t\t\t\t", ",\n\t\t\t\t\t"), $arrCustomFieldSql['strSelect'], $arrAttachmentSql['strSelect'], $objQueryExpansion->GetFromSql("", "\n\t\t\t\t\t"), $arrCustomFieldSql['strFrom'], $arrAttachmentSql['strFrom'], $arrSearchSql['strCategorySql'], $arrSearchSql['strManufacturerSql'], $arrSearchSql['strDescriptionSql'], $arrSearchSql['strAssetModelCodeSql'], $arrSearchSql['strDateModifiedSql'], $arrSearchSql['strAttachmentSql'], $arrSearchSql['strAuthorizationSql'], $arrAttachmentSql['strGroupBy'], $strOrderBy, $strLimitSuffix);
        $objDbResult = $objDatabase->Query($strQuery);
        return AssetModel::InstantiateDbResult($objDbResult);
    }
开发者ID:heshuai64,项目名称:einv2,代码行数:56,代码来源:AssetModel.class.php


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