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


PHP CIBlockElement::SubQuery方法代码示例

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


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

示例1: array

				{
					$arPriceFilter[$key] = $value;
					unset($arrFilter[$key]);
				}
			}

			if(!empty($arPriceFilter))
			{
				$arSubFilter = $arPriceFilter;
				$arSubFilter["IBLOCK_ID"] = $arOffersIBlock["OFFERS_IBLOCK_ID"];
				$arSubFilter["ACTIVE_DATE"] = "Y";
				$arSubFilter["ACTIVE"] = "Y";
				$arFilter[] = array(
					"LOGIC" => "OR",
					array($arPriceFilter),
					"=ID" => CIBlockElement::SubQuery("PROPERTY_".$arOffersIBlock["OFFERS_PROPERTY_ID"], $arSubFilter),
				);
			}
		}
	}

	//PRICES
	$arPriceTypeID = array();
	if(!$arParams["USE_PRICE_COUNT"])
	{
		foreach($arResult["PRICES"] as &$value)
		{
			$arSelect[] = $value["SELECT"];
			$arFilter["CATALOG_SHOP_QUANTITY_".$value["ID"]] = $arParams["SHOW_PRICE_COUNT"];
		}
		if (isset($value))
开发者ID:ASDAFF,项目名称:bitrix-5,代码行数:31,代码来源:component.php

示例2: array_merge

         } else {
             $arSubFilter = array_merge($arrFilter["OFFERS"], $arPriceFilter);
         }
         $arSubFilter["IBLOCK_ID"] = $arResult['CATALOG']['IBLOCK_ID'];
         $arSubFilter["ACTIVE_DATE"] = "Y";
         $arSubFilter["ACTIVE"] = "Y";
         if ('Y' == $arParams['HIDE_NOT_AVAILABLE']) {
             $arSubFilter['CATALOG_AVAILABLE'] = 'Y';
         }
         $arFilter["=ID"] = CIBlockElement::SubQuery("PROPERTY_" . $arResult['CATALOG']["SKU_PROPERTY_ID"], $arSubFilter);
     } elseif (!empty($arPriceFilter)) {
         $arSubFilter = $arPriceFilter;
         $arSubFilter["IBLOCK_ID"] = $arResult['CATALOG']['IBLOCK_ID'];
         $arSubFilter["ACTIVE_DATE"] = "Y";
         $arSubFilter["ACTIVE"] = "Y";
         $arFilter[] = array("LOGIC" => "OR", array($arPriceFilter), "=ID" => CIBlockElement::SubQuery("PROPERTY_" . $arResult['CATALOG']["SKU_PROPERTY_ID"], $arSubFilter));
     }
 }
 //PRICES
 $arPriceTypeID = array();
 if (!$arParams["USE_PRICE_COUNT"]) {
     foreach ($arResult["PRICES"] as &$value) {
         if (!$value['CAN_VIEW'] && !$value['CAN_BUY']) {
             continue;
         }
         $arSelect[] = $value["SELECT"];
         $arFilter["CATALOG_SHOP_QUANTITY_" . $value["ID"]] = $arParams["SHOW_PRICE_COUNT"];
     }
     if (isset($value)) {
         unset($value);
     }
开发者ID:rasuldev,项目名称:torino,代码行数:31,代码来源:component.php

示例3: makeFilter

 function makeFilter($FILTER_NAME)
 {
     $bOffersIBlockExist = false;
     if (self::$catalogIncluded === null) {
         self::$catalogIncluded = Loader::includeModule('catalog');
     }
     if (self::$catalogIncluded) {
         $arCatalog = CCatalogSKU::GetInfoByProductIBlock($this->IBLOCK_ID);
         if (!empty($arCatalog)) {
             $bOffersIBlockExist = true;
         }
     }
     $gFilter = $GLOBALS[$FILTER_NAME];
     $arFilter = array("IBLOCK_ID" => $this->IBLOCK_ID, "IBLOCK_LID" => SITE_ID, "IBLOCK_ACTIVE" => "Y", "ACTIVE_DATE" => "Y", "ACTIVE" => "Y", "CHECK_PERMISSIONS" => "Y", "MIN_PERMISSION" => "R", "INCLUDE_SUBSECTIONS" => $this->arParams["INCLUDE_SUBSECTIONS"] != 'N' ? 'Y' : 'N');
     if ($this->SECTION_ID > 0 || $this->arParams["SHOW_ALL_WO_SECTION"] !== "Y") {
         $arFilter["SECTION_ID"] = $this->SECTION_ID;
     }
     if ($this->arParams['HIDE_NOT_AVAILABLE'] == 'Y') {
         $arFilter['CATALOG_AVAILABLE'] = 'Y';
     }
     if (self::$catalogIncluded && $bOffersIBlockExist) {
         $arPriceFilter = array();
         foreach ($gFilter as $key => $value) {
             if (preg_match('/^(>=|<=|><)CATALOG_PRICE_/', $key)) {
                 $arPriceFilter[$key] = $value;
                 unset($gFilter[$key]);
             }
         }
         if (!empty($gFilter["OFFERS"])) {
             if (empty($arPriceFilter)) {
                 $arSubFilter = $gFilter["OFFERS"];
             } else {
                 $arSubFilter = array_merge($gFilter["OFFERS"], $arPriceFilter);
             }
             $arSubFilter["IBLOCK_ID"] = $this->SKU_IBLOCK_ID;
             $arSubFilter["ACTIVE_DATE"] = "Y";
             $arSubFilter["ACTIVE"] = "Y";
             if ('Y' == $this->arParams['HIDE_NOT_AVAILABLE']) {
                 $arSubFilter['CATALOG_AVAILABLE'] = 'Y';
             }
             $arFilter["=ID"] = CIBlockElement::SubQuery("PROPERTY_" . $this->SKU_PROPERTY_ID, $arSubFilter);
         } elseif (!empty($arPriceFilter)) {
             $arSubFilter = $arPriceFilter;
             $arSubFilter["IBLOCK_ID"] = $this->SKU_IBLOCK_ID;
             $arSubFilter["ACTIVE_DATE"] = "Y";
             $arSubFilter["ACTIVE"] = "Y";
             $arFilter[] = array("LOGIC" => "OR", array($arPriceFilter), "=ID" => CIBlockElement::SubQuery("PROPERTY_" . $this->SKU_PROPERTY_ID, $arSubFilter));
         }
         unset($gFilter["OFFERS"]);
     }
     return array_merge($gFilter, $arFilter);
 }
开发者ID:mrdeadmouse,项目名称:u136006,代码行数:52,代码来源:class.php

示例4:

		else
		{
			$value = ${"find_sub_el_property_".$arProp["ID"]};
			if(is_array($value) || strlen($value))
			{
				if($value === "NOT_REF")
					$value = false;
				$arSubQuery["?PROPERTY_".$arProp["ID"]] = $value;
			}
		}
	}
}

if ($boolSKU && 1 < sizeof($arSubQuery))
{
	$arFilter['ID'] = CIBlockElement::SubQuery('PROPERTY_'.$arCatalog['SKU_PROPERTY_ID'], $arSubQuery);
}

if(IntVal($find_section_section)<0 || strlen($find_section_section)<=0)
	unset($arFilter["SECTION_ID"]);

// Handle edit action (check for permission before save!)
if($lAdmin->EditAction())
{
	if(is_array($_FILES['FIELDS']))
		CAllFile::ConvertFilesToPost($_FILES['FIELDS'], $_POST['FIELDS']);

	foreach($_POST['FIELDS'] as $ID=>$arFields)
	{
		if(!$lAdmin->IsUpdated($ID))
			continue;
开发者ID:nycmic,项目名称:bittest,代码行数:31,代码来源:iblock_list_admin.php

示例5: makeFilter

	function makeFilter($FILTER_NAME)
	{
		$gFilter = $GLOBALS[$FILTER_NAME];

		$arFilter = array(
			"IBLOCK_ID" => $this->IBLOCK_ID,
			"IBLOCK_LID" => SITE_ID,
			"IBLOCK_ACTIVE" => "Y",
			"ACTIVE_DATE" => "Y",
			"ACTIVE" => "Y",
			"CHECK_PERMISSIONS" => "Y",
			"MIN_PERMISSION" => "R",
			"INCLUDE_SUBSECTIONS" => "Y", //($arParams["INCLUDE_SUBSECTIONS"] != 'N' ? 'Y' : 'N'),
			"SECTION_ID" => $this->SECTION_ID,
		);

		if(is_array($gFilter["OFFERS"]))
		{
			if(!empty($gFilter["OFFERS"]))
			{
				$arSubFilter = $gFilter["OFFERS"];
				$arSubFilter["IBLOCK_ID"] = $this->SKU_IBLOCK_ID;
				$arSubFilter["ACTIVE_DATE"] = "Y";
				$arSubFilter["ACTIVE"] = "Y";
				$arFilter["=ID"] = CIBlockElement::SubQuery("PROPERTY_".$this->SKU_PROPERTY_ID, $arSubFilter);
			}

			$arPriceFilter = array();
			foreach($gFilter as $key => $value)
			{
				if(preg_match('/^(>=|<=|><)CATALOG_PRICE_/', $key))
				{
					$arPriceFilter[$key] = $value;
					unset($gFilter[$key]);
				}
			}

			if(!empty($arPriceFilter))
			{
				$arSubFilter = $arPriceFilter;
				$arSubFilter["IBLOCK_ID"] = $this->SKU_IBLOCK_ID;
				$arSubFilter["ACTIVE_DATE"] = "Y";
				$arSubFilter["ACTIVE"] = "Y";
				$arFilter[] = array(
					"LOGIC" => "OR",
					array($arPriceFilter),
					"=ID" => CIBlockElement::SubQuery("PROPERTY_".$this->SKU_PROPERTY_ID, $arSubFilter),
				);
			}

			unset($gFilter["OFFERS"]);
		}

		return array_merge($gFilter, $arFilter);
	}
开发者ID:ASDAFF,项目名称:bitrix-5,代码行数:55,代码来源:class.php

示例6: array

        $arCatalog = false;
        if ($catalogIncluded) {
            $arCatalog = CCatalog::GetByID($arParams["IBLOCK_ID"]);
            if (!empty($arCatalog) && is_array($arCatalog)) {
                $bIBlockCatalog = true;
            }
        }
        $arResult['CATALOG'] = $arCatalog;
        $arSelect = array("ID", "NAME");
        $arFilter = array("!ID" => array_keys($arCompare), "IBLOCK_LID" => SITE_ID, "IBLOCK_ACTIVE" => "Y", "ACTIVE_DATE" => "Y", "ACTIVE" => "Y", "CHECK_PERMISSIONS" => "Y");
        if ($bIBlockCatalog && 'Y' == $arParams['HIDE_NOT_AVAILABLE']) {
            $arFilter['CATALOG_AVAILABLE'] = 'Y';
        }
        if ($arResult["OFFERS_IBLOCK_ID"] > 0) {
            $arFilter["IBLOCK_ID"] = array($arParams["IBLOCK_ID"], $arResult["OFFERS_IBLOCK_ID"]);
            $arFilter["!=ID"] = CIBlockElement::SubQuery("PROPERTY_" . $arResult["OFFERS_PROPERTY_ID"], array("IBLOCK_ID" => $arResult["OFFERS_IBLOCK_ID"]));
        } else {
            $arFilter["IBLOCK_ID"] = $arParams["IBLOCK_ID"];
        }
        $arSort = array($arParams["ELEMENT_SORT_FIELD_BOX"] => $arParams["ELEMENT_SORT_ORDER_BOX"], $arParams["ELEMENT_SORT_FIELD_BOX2"] => $arParams["ELEMENT_SORT_ORDER_BOX2"]);
        $rsElements = CIBlockElement::GetList($arSort, $arFilter, false, false, $arSelect);
        while ($arElement = $rsElements->GetNext()) {
            $arResult["ITEMS_TO_ADD"][$arElement["ID"]] = $arElement["NAME"];
        }
    }
    $this->IncludeComponentTemplate();
} else {
    $actionByAjax = isset($_REQUEST['ajax_action']) && $_REQUEST['ajax_action'] == 'Y';
    if ($actionByAjax) {
        $APPLICATION->RestartBuffer();
        ShowNote(GetMessage("CATALOG_COMPARE_LIST_EMPTY"));
开发者ID:webgksupport,项目名称:alpina,代码行数:31,代码来源:component.php

示例7: array

			$arSubFilter["ACTIVE"] = "Y";
			if ('Y' == $arParams['HIDE_NOT_AVAILABLE'])
				$arSubFilter['CATALOG_AVAILABLE'] = 'Y';
			$arFilter["=ID"] = CIBlockElement::SubQuery("PROPERTY_".$arResult['CATALOG']["SKU_PROPERTY_ID"], $arSubFilter);
		}
		elseif(!empty($arPriceFilter))
		{
			$arSubFilter = $arPriceFilter;

			$arSubFilter["IBLOCK_ID"] = $arResult['CATALOG']['IBLOCK_ID'];
			$arSubFilter["ACTIVE_DATE"] = "Y";
			$arSubFilter["ACTIVE"] = "Y";
			$arFilter[] = array(
				"LOGIC" => "OR",
				array($arPriceFilter),
				"=ID" => CIBlockElement::SubQuery("PROPERTY_".$arResult['CATALOG']["SKU_PROPERTY_ID"], $arSubFilter),
			);
		}
	}

	//PRICES
	$arPriceTypeID = array();
	if(!$arParams["USE_PRICE_COUNT"])
	{
		foreach($arResult["PRICES"] as &$value)
		{
			if (!$value['CAN_VIEW'] && !$value['CAN_BUY'])
				continue;
			$arSelect[] = $value["SELECT"];
			$arFilter["CATALOG_SHOP_QUANTITY_".$value["ID"]] = $arParams["SHOW_PRICE_COUNT"];
		}
开发者ID:nycmic,项目名称:bittest,代码行数:31,代码来源:component.php

示例8: array

             $arSubFilter["ACTIVE"] = "Y";
             $arFilter["=ID"] = CIBlockElement::SubQuery("PROPERTY_" . $arOffersIBlock["OFFERS_PROPERTY_ID"], $arSubFilter);
         }
         $arPriceFilter = array();
         foreach ($arrFilter as $key => $value) {
             if (preg_match('/^(>=|<=)CATALOG_PRICE_/', $key)) {
                 $arPriceFilter[$key] = $value;
                 unset($arrFilter[$key]);
             }
         }
         if (!empty($arPriceFilter)) {
             $arSubFilter = $arPriceFilter;
             $arSubFilter["IBLOCK_ID"] = $arOffersIBlock["OFFERS_IBLOCK_ID"];
             $arSubFilter["ACTIVE_DATE"] = "Y";
             $arSubFilter["ACTIVE"] = "Y";
             $arFilter[] = array("LOGIC" => "OR", array($arPriceFilter), "=ID" => CIBlockElement::SubQuery("PROPERTY_" . $arOffersIBlock["OFFERS_PROPERTY_ID"], $arSubFilter));
         }
     }
 }
 //PRICES
 $arPriceTypeID = array();
 if (!$arParams["USE_PRICE_COUNT"]) {
     foreach ($arResult["PRICES"] as &$value) {
         $arSelect[] = $value["SELECT"];
         $arFilter["CATALOG_SHOP_QUANTITY_" . $value["ID"]] = $arParams["SHOW_PRICE_COUNT"];
     }
     if (isset($value)) {
         unset($value);
     }
 } else {
     foreach ($arResult["PRICES"] as &$value) {
开发者ID:k-kalashnikov,项目名称:geekcon_new,代码行数:31,代码来源:component.php

示例9: makeFilter

 function makeFilter($FILTER_NAME)
 {
     $bOffersIBlockExist = false;
     $arCatalog = false;
     $bCatalog = \Bitrix\Main\Loader::includeModule('catalog');
     if ($bCatalog) {
         $arCatalog = CCatalogSKU::GetInfoByIBlock($this->IBLOCK_ID);
         if (!empty($arCatalog) && is_array($arCatalog)) {
             $bOffersIBlockExist = $arCatalog['CATALOG_TYPE'] == CCatalogSKU::TYPE_PRODUCT || $arCatalog['CATALOG_TYPE'] == CCatalogSKU::TYPE_FULL;
         }
     }
     $gFilter = $GLOBALS[$FILTER_NAME];
     $arFilter = array("IBLOCK_ID" => $this->IBLOCK_ID, "IBLOCK_LID" => SITE_ID, "IBLOCK_ACTIVE" => "Y", "ACTIVE_DATE" => "Y", "ACTIVE" => "Y", "CHECK_PERMISSIONS" => "Y", "MIN_PERMISSION" => "R", "INCLUDE_SUBSECTIONS" => "Y", "SECTION_ID" => $this->SECTION_ID);
     if ('Y' == $this->arParams['HIDE_NOT_AVAILABLE']) {
         $arFilter['CATALOG_AVAILABLE'] = 'Y';
     }
     if ($bCatalog && $bOffersIBlockExist) {
         $arPriceFilter = array();
         foreach ($gFilter as $key => $value) {
             if (preg_match('/^(>=|<=|><)CATALOG_PRICE_/', $key)) {
                 $arPriceFilter[$key] = $value;
                 unset($gFilter[$key]);
             }
         }
         if (!empty($gFilter["OFFERS"]) && !empty($arPriceFilter)) {
             $arSubFilter = array_merge($gFilter["OFFERS"], $arPriceFilter);
             $arSubFilter["IBLOCK_ID"] = $this->SKU_IBLOCK_ID;
             $arSubFilter["ACTIVE_DATE"] = "Y";
             $arSubFilter["ACTIVE"] = "Y";
             if ('Y' == $this->arParams['HIDE_NOT_AVAILABLE']) {
                 $arSubFilter['CATALOG_AVAILABLE'] = 'Y';
             }
             $arFilter[] = array("LOGIC" => "OR", array($arPriceFilter), "=ID" => CIBlockElement::SubQuery("PROPERTY_" . $this->SKU_PROPERTY_ID, $arSubFilter));
         } elseif (!empty($gFilter["OFFERS"])) {
             $arSubFilter = $gFilter["OFFERS"];
             $arSubFilter["IBLOCK_ID"] = $this->SKU_IBLOCK_ID;
             $arSubFilter["ACTIVE_DATE"] = "Y";
             $arSubFilter["ACTIVE"] = "Y";
             if ('Y' == $this->arParams['HIDE_NOT_AVAILABLE']) {
                 $arSubFilter['CATALOG_AVAILABLE'] = 'Y';
             }
             $arFilter["=ID"] = CIBlockElement::SubQuery("PROPERTY_" . $this->SKU_PROPERTY_ID, $arSubFilter);
         } elseif (!empty($arPriceFilter)) {
             $arSubFilter = $arPriceFilter;
             $arSubFilter["IBLOCK_ID"] = $this->SKU_IBLOCK_ID;
             $arSubFilter["ACTIVE_DATE"] = "Y";
             $arSubFilter["ACTIVE"] = "Y";
             $arFilter[] = array("LOGIC" => "OR", array($arPriceFilter), "=ID" => CIBlockElement::SubQuery("PROPERTY_" . $this->SKU_PROPERTY_ID, $arSubFilter));
         }
         unset($gFilter["OFFERS"]);
     }
     return array_merge($gFilter, $arFilter);
 }
开发者ID:spas-viktor,项目名称:books,代码行数:53,代码来源:class.php


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