本文整理汇总了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))
示例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);
}
示例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);
}
示例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;
示例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);
}
示例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"));
示例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"];
}
示例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) {
示例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);
}