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


PHP CCatalogProductSet::getList方法代码示例

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


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

示例1: implode

			}
			foreach($arBarCodes as $productId => $barcode)
			{
				if (isset($arRows['E'.$productId]))
				{
					$arRows['E'.$productId]->arRes["CATALOG_BAR_CODE"] = implode(', ', $barcode);
				}
			}
		}
	}
	if (!empty($arProductGroupIDs))
	{
		$rsSets = CCatalogProductSet::getList(
			array(),
			array('OWNER_ID' => array_keys($arProductGroupIDs), 'SET_ID' => 0, 'TYPE' => CCatalogProductSet::TYPE_GROUP),
			false,
			false,
			array('ID', 'OWNER_ID', 'ITEM_ID', 'SET_ID', 'TYPE')
		);
		while ($arSet = $rsSets->Fetch())
		{
			$arSet['OWNER_ID'] = (int)$arSet['OWNER_ID'];
			$arSet['ITEM_ID'] = (int)$arSet['ITEM_ID'];
			if ($arSet['OWNER_ID'] == $arSet['ITEM_ID'] && isset($arProductGroupIDs[$arSet['OWNER_ID']]))
			{
				$arProductGroupIDs[$arSet['OWNER_ID']] = true;
			}
		}
	}
	if (!empty($arProductIDs))
	{
开发者ID:nycmic,项目名称:bittest,代码行数:31,代码来源:iblock_list_admin.php

示例2: makeItemsFromDbResult

 /**
  * @param  \CDBResult $dbResultList
  * @return array
  */
 protected function makeItemsFromDbResult(\CDBResult $dbResultList)
 {
     $arItemsResult = $arProductIds = array();
     while ($arItem = $dbResultList->Fetch()) {
         if ($arItem['TYPE'] != 'S') {
             $arProductIds[] = $arItem['ID'];
             $arItem['PROPERTIES'] = $this->getItemProperies($arItem['ID']);
         }
         $arItemsResult[$arItem['ID']] = $arItem;
     }
     if (!empty($arProductIds)) {
         $dbCatalogProduct = \CCatalogProduct::GetList(array(), array("ID" => $arProductIds));
         while ($arCatalogProduct = $dbCatalogProduct->fetch()) {
             $arItemsResult[$arCatalogProduct["ID"]]['PRODUCT'] = $arCatalogProduct;
         }
         $offersExistsIds = \CCatalogSKU::getExistOffers($arProductIds, $this->getIblockId());
         $noOffersIds = array();
         if ($offersExistsIds === false) {
             $noOffersIds = $arProductIds;
         } else {
             $this->loadAllSku(array_keys(array_filter($offersExistsIds)));
             foreach ($offersExistsIds as $id => $bExists) {
                 $arItem =& $arItemsResult[$id];
                 if ($bExists) {
                     $arItem['SKU_ITEMS'] = $this->getProductSku($arItem);
                 } else {
                     $noOffersIds[] = $id;
                 }
             }
         }
         if (!empty($noOffersIds)) {
             $priceIds = $this->getVisiblePrices();
             foreach ($priceIds as $priceId) {
                 $dbPrice = \CPrice::GetList(array(), array('PRODUCT_ID' => $noOffersIds, 'CATALOG_GROUP_ID' => $priceId), false, false, array('PRODUCT_ID', 'PRICE', 'CURRENCY'));
                 while ($arPrice = $dbPrice->fetch()) {
                     $arItemsResult[$arPrice["PRODUCT_ID"]]['PRICES'][$priceId] = array('PRICE' => $arPrice['PRICE'], 'CURRENCY' => $arPrice['CURRENCY']);
                 }
             }
             if ($this->getStoreId()) {
                 $dbStoreProduct = \CCatalogStoreProduct::GetList(array(), array("PRODUCT_ID" => $noOffersIds, "STORE_ID" => $this->getStoreId()));
                 while ($arStoreProduct = $dbStoreProduct->Fetch()) {
                     $arItemsResult[$arStoreProduct["PRODUCT_ID"]]['PRODUCT']['STORE_AMOUNT'] = $arStoreProduct["AMOUNT"];
                 }
             }
             $groupsIterator = CCatalogProductSet::getList(array(), array('OWNER_ID' => $noOffersIds, 'SET_ID' => 0, 'TYPE' => \CCatalogProductSet::TYPE_GROUP), false, false, array('ID', 'OWNER_ID', 'ITEM_ID', 'SET_ID', 'TYPE'));
             while ($group = $groupsIterator->Fetch()) {
                 if ($group['OWNER_ID'] == $group['ITEM_ID']) {
                     $arItemsResult[$group['OWNER_ID']]['PRODUCT']['IS_GROUP'] = true;
                 }
             }
         }
     }
     return $arItemsResult;
 }
开发者ID:ASDAFF,项目名称:1C_Bitrix_info_site,代码行数:58,代码来源:class.php

示例3: getAllCounter

 public static function getAllCounter()
 {
     return (int) CCatalogProductSet::getList(array(), array('TYPE' => CCatalogProductSet::TYPE_SET, 'SET_ID' => 0), array());
 }
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:4,代码来源:step_operations.php

示例4: base64_encode

			}
		}
	}
	$arResult['OFFERS_PROP'] = $arUsedFields;
	$arResult['OFFERS_PROP_CODES'] = (!empty($arUsedFields) ? base64_encode(serialize(array_keys($arUsedFields))) : '');

	\Bitrix\Main\Type\Collection::sortByColumn($arResult['OFFERS'], $arSortFields);

	if (!empty($arIDS) && CBXFeatures::IsFeatureEnabled('CatCompleteSet'))
	{
		$rsSets = CCatalogProductSet::getList(
			array(),
			array(
				'@OWNER_ID' => $arIDS,
				'=SET_ID' => 0,
				'=TYPE' => CCatalogProductSet::TYPE_GROUP
			),
			false,
			false,
			array('ID', 'OWNER_ID')
		);
		while ($arSet = $rsSets->Fetch())
		{
			$arOfferSet[$arSet['OWNER_ID']] = true;
			$arResult['OFFER_GROUP'] = true;
		}
	}

	$arMatrix = array();
	$intSelected = -1;
	$arResult['MIN_PRICE'] = false;
开发者ID:ASDAFF,项目名称:mp,代码行数:31,代码来源:result_modifier.php

示例5: makeItemsFromDbResult

 /**
  * @param  \CDBResult $dbResultList
  * @return array
  */
 protected function makeItemsFromDbResult(\CDBResult $dbResultList)
 {
     $arItemsResult = $arProductIds = array();
     while ($arItem = $dbResultList->Fetch()) {
         if ($arItem['TYPE'] != 'S') {
             $arProductIds[] = $arItem['ID'];
             $arItem['PROPERTIES'] = $this->getItemProperies($arItem['ID']);
             $arItemsResult[$arItem['ID']] = $arItem;
         } else {
             $arItemsResult['S' . $arItem['ID']] = $arItem;
         }
     }
     if (!empty($arProductIds)) {
         $dbCatalogProduct = \CCatalogProduct::GetList(array(), array('@ID' => $arProductIds));
         while ($arCatalogProduct = $dbCatalogProduct->fetch()) {
             $arItemsResult[$arCatalogProduct['ID']]['PRODUCT'] = $arCatalogProduct;
         }
         $offersExistsIds = \CCatalogSKU::getExistOffers($arProductIds, $this->getIblockId());
         $noOffersIds = array();
         if (empty($offersExistsIds)) {
             $noOffersIds = $arProductIds;
         } else {
             $this->loadAllSku(array_keys(array_filter($offersExistsIds)));
             foreach ($offersExistsIds as $id => $bExists) {
                 $arItem =& $arItemsResult[$id];
                 if ($bExists) {
                     $arItem['SKU_ITEMS'] = $this->getProductSku($arItem);
                 } else {
                     $noOffersIds[] = $id;
                 }
             }
             unset($id, $bExists);
         }
         if (!empty($noOffersIds)) {
             $productRatioList = Catalog\ProductTable::getCurrentRatioWithMeasure($noOffersIds);
             if (!empty($productRatioList)) {
                 foreach ($productRatioList as $productId => $productRatio) {
                     if (!isset($arItemsResult[$productId]['PRODUCT'])) {
                         continue;
                     }
                     $arItemsResult[$productId]['PRODUCT']['MEASURE_RATIO'] = $productRatio['RATIO'];
                     $arItemsResult[$productId]['PRODUCT']['MEASURE'] = $productRatio['MEASURE'];
                 }
                 unset($productRatio, $productId);
             }
             unset($productRatioList);
             $priceIds = $this->getVisiblePrices();
             foreach ($priceIds as $priceId) {
                 $dbPrice = \CPrice::GetListEx(array(), array('PRODUCT_ID' => $noOffersIds, 'CATALOG_GROUP_ID' => $priceId), false, false, array('PRODUCT_ID', 'PRICE', 'CURRENCY', 'QUANTITY_FROM', 'QUANTITY_TO'));
                 while ($arPrice = $dbPrice->fetch()) {
                     $arPrice['QUANTITY_FROM'] = (int) $arPrice['QUANTITY_FROM'];
                     $arPrice['QUANTITY_TO'] = (int) $arPrice['QUANTITY_TO'];
                     if (!isset($arItemsResult[$arPrice["PRODUCT_ID"]]['PRICES'][$priceId]) || $arItemsResult[$arPrice["PRODUCT_ID"]]['PRICES'][$priceId]['QUANTITY_FROM'] > $arPrice['QUANTITY_FROM']) {
                         $arItemsResult[$arPrice["PRODUCT_ID"]]['PRICES'][$priceId] = array('PRICE' => $arPrice['PRICE'], 'CURRENCY' => $arPrice['CURRENCY'], 'QUANTITY_FROM' => $arPrice['QUANTITY_FROM'], 'QUANTITY_TO' => $arPrice['QUANTITY_TO']);
                     }
                 }
                 unset($arPrice, $dbPrice);
             }
             if ($this->getStoreId()) {
                 $dbStoreProduct = \CCatalogStoreProduct::GetList(array(), array("PRODUCT_ID" => $noOffersIds, "STORE_ID" => $this->getStoreId()));
                 while ($arStoreProduct = $dbStoreProduct->Fetch()) {
                     $arItemsResult[$arStoreProduct["PRODUCT_ID"]]['PRODUCT']['STORE_AMOUNT'] = $arStoreProduct["AMOUNT"];
                 }
             }
             $groupsIterator = CCatalogProductSet::getList(array(), array('OWNER_ID' => $noOffersIds, 'SET_ID' => 0, 'TYPE' => \CCatalogProductSet::TYPE_GROUP), false, false, array('ID', 'OWNER_ID', 'ITEM_ID', 'SET_ID', 'TYPE'));
             while ($group = $groupsIterator->Fetch()) {
                 if ($group['OWNER_ID'] == $group['ITEM_ID']) {
                     $arItemsResult[$group['OWNER_ID']]['PRODUCT']['IS_GROUP'] = true;
                 }
             }
         }
     }
     return $arItemsResult;
 }
开发者ID:Satariall,项目名称:izurit,代码行数:78,代码来源:class.php


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