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


PHP CCatalogMeasureRatio::getList方法代码示例

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


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

示例1: array

	$arResult["SET_ITEMS"]["DEFAULT"] = array();
	$arResult["SET_ITEMS"]["OTHER"] = array();
	$arResult["SET_ITEMS"]["PRICE"] = 0;
	$arResult["SET_ITEMS"]["OLD_PRICE"] = 0;
	$arResult["SET_ITEMS"]["PRICE_DISCOUNT_DIFFERENCE"] = 0;

	$arSetItemsRatio = array();
	foreach ($arSetItemsID as $key=>$itemID)
	{
		$arSetItemsRatio[$itemID] = 1;
	}
	$rsRatios = CCatalogMeasureRatio::getList(
		array(),
		array('PRODUCT_ID' => $arSetItemsID),
		false,
		false,
		array('PRODUCT_ID', 'RATIO')
	);
	while ($arRatio = $rsRatios->Fetch())
	{
		if (in_array($arRatio['PRODUCT_ID'], $arSetItemsID))
		{
			$intRatio = (int)$arRatio['RATIO'];
			$dblRatio = (float)($arRatio['RATIO']);
			$arSetItemsRatio[$arRatio['PRODUCT_ID']] = ($dblRatio > $intRatio ? $dblRatio : $intRatio);
			$arSetItemsRatio[$arRatio['PRODUCT_ID']] = ($arSetItemsRatio[$arRatio['PRODUCT_ID']] > 0) ? $arSetItemsRatio[$arRatio['PRODUCT_ID']] : 1;
		}
	}
	$arResult["ITEMS_RATIO"] = $arSetItemsRatio;
开发者ID:ASDAFF,项目名称:entask.ru,代码行数:29,代码来源:component.php

示例2: unset

             }
             if ($bGetProductProperties) {
                 $arItem["PRODUCT_PROPERTIES"] = CIBlockPriceTools::GetProductProperties($arParams["IBLOCK_ID"], $arItem["ID"], $arParams["PRODUCT_PROPERTIES"], $arItem["PROPERTIES"]);
                 if (!empty($arItem["PRODUCT_PROPERTIES"])) {
                     $arItem['PRODUCT_PROPERTIES_FILL'] = CIBlockPriceTools::getFillProductProperties($arItem['PRODUCT_PROPERTIES']);
                 }
             }
         }
     }
     if (isset($arItem)) {
         unset($arItem);
     }
 }
 if ($bIBlockCatalog) {
     if (!empty($arResult["ELEMENTS"])) {
         $rsRatios = CCatalogMeasureRatio::getList(array(), array('PRODUCT_ID' => $arResult["ELEMENTS"]), false, false, array('PRODUCT_ID', 'RATIO'));
         while ($arRatio = $rsRatios->Fetch()) {
             $arRatio['PRODUCT_ID'] = (int) $arRatio['PRODUCT_ID'];
             if (isset($arElementLink[$arRatio['PRODUCT_ID']])) {
                 $intRatio = (int) $arRatio['RATIO'];
                 $dblRatio = doubleval($arRatio['RATIO']);
                 $mxRatio = $dblRatio > $intRatio ? $dblRatio : $intRatio;
                 if (CATALOG_VALUE_EPSILON > abs($mxRatio)) {
                     $mxRatio = 1;
                 } elseif (0 > $mxRatio) {
                     $mxRatio = 1;
                 }
                 $arElementLink[$arRatio['PRODUCT_ID']]['CATALOG_MEASURE_RATIO'] = $mxRatio;
             }
         }
     }
开发者ID:rasuldev,项目名称:torino,代码行数:31,代码来源:component.php

示例3: GetMessage

        }
        ?>
			</td>
		</tr>
	<?php 
        if (!empty($arAllMeasure)) {
            ?>
		<tr>
			<td width="40%"><?php 
            echo GetMessage("C2IT_MEASURE_RATIO");
            ?>
:</td>
			<td width="60%"><?php 
            $str_CAT_MEASURE_RATIO = 1;
            $CAT_MEASURE_RATIO_ID = 0;
            $db_CAT_MEASURE_RATIO = CCatalogMeasureRatio::getList(array(), array("PRODUCT_ID" => $PRODUCT_ID));
            if ($ar_CAT_MEASURE_RATIO = $db_CAT_MEASURE_RATIO->Fetch()) {
                $str_CAT_MEASURE_RATIO = $ar_CAT_MEASURE_RATIO["RATIO"];
                $CAT_MEASURE_RATIO_ID = $ar_CAT_MEASURE_RATIO["ID"];
            }
            if ($bVarsFromForm) {
                $str_CAT_MEASURE_RATIO = $CAT_MEASURE_RATIO;
            }
            ?>
				<input type="text" <?php 
            if ($bReadOnly || $productIsSet) {
                echo "disabled readonly";
            }
            ?>
 id="CAT_MEASURE_RATIO" name="CAT_MEASURE_RATIO" value="<?php 
            echo htmlspecialcharsbx($str_CAT_MEASURE_RATIO);
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:31,代码来源:product_edit.php

示例4: array

 }
 if ($arCatalog["SUBSCRIPTION"] == "Y") {
     $arFields["PRICE_TYPE"] = $CAT_PRICE_TYPE;
     $arFields["RECUR_SCHEME_TYPE"] = $CAT_RECUR_SCHEME_TYPE;
     $arFields["RECUR_SCHEME_LENGTH"] = $CAT_RECUR_SCHEME_LENGTH;
     $arFields["TRIAL_PRICE_ID"] = $CAT_TRIAL_PRICE_ID;
     $arFields["WITHOUT_ORDER"] = $CAT_WITHOUT_ORDER;
 }
 CCatalogProduct::Add($arFields);
 $arMeasureRatio = array('PRODUCT_ID' => $PRODUCT_ID, 'RATIO' => $CAT_MEASURE_RATIO);
 $newRatio = true;
 $currentRatioID = 0;
 if (isset($_POST['CAT_MEASURE_RATIO_ID'])) {
     $currentRatioID = (int) $_POST['CAT_MEASURE_RATIO_ID'];
     if ($currentRatioID > 0) {
         $ratioIterator = CCatalogMeasureRatio::getList(array(), array('ID' => $currentRatioID, 'PRODUCT_ID' => $PRODUCT_ID), false, false, array('ID', 'PRODUCT_ID'));
         if ($currentRatio = $ratioIterator->Fetch()) {
             $newRatio = false;
         }
         unset($currentRatio, $ratioIterator);
     }
 }
 if ($newRatio) {
     CCatalogMeasureRatio::add($arMeasureRatio);
 } else {
     CCatalogMeasureRatio::update($currentRatioID, $arMeasureRatio);
 }
 unset($currentRatioID, $newRatio, $arMeasureRatio);
 $intCountBasePrice = count($arCatalogBasePrices);
 for ($i = 0; $i < $intCountBasePrice; $i++) {
     if (strlen($arCatalogBasePrices[$i]["PRICE"]) > 0) {
开发者ID:Satariall,项目名称:izurit,代码行数:31,代码来源:product_edit_action.php

示例5: array

				{
					if ($showCatalogWithOffers || $arRows['E'.$intID]->arRes['CATALOG_TYPE'] != CCatalogProduct::TYPE_SKU)
						$arRows['E'.$intID]->AddViewField('CATALOG_MEASURE', $strMeasure);
					else
						$arRows['E'.$intID]->AddViewField('CATALOG_MEASURE', ' ');
				}
			}
		}
	}
	if (isset($arVisibleColumnsMap['CATALOG_MEASURE_RATIO']))
	{
		$arRatioList = array();
		$rsRatios = CCatalogMeasureRatio::getList(
			array(),
			array('@PRODUCT_ID' => $arElemID),
			false,
			false,
			array('ID', 'PRODUCT_ID', 'RATIO')
		);
		while ($arRatio = $rsRatios->Fetch())
		{
			$arRatio['PRODUCT_ID'] = (int)$arRatio['PRODUCT_ID'];
			$arRatioList[$arRatio['PRODUCT_ID']] = $arRatio['RATIO'];
		}
		if (!empty($arRatioList))
		{
			foreach ($arElemID as &$intOneElemID)
			{
				$arRows['E'.$intOneElemID]->arRes['CATALOG_MEASURE_RATIO'] = (isset($arRatioList[$intOneElemID]) ? $arRatioList[$intOneElemID] : 1);
				if ($showCatalogWithOffers || $arRows['E'.$intOneElemID]->arRes['CATALOG_TYPE'] != CCatalogProduct::TYPE_SKU)
				{
开发者ID:nycmic,项目名称:bittest,代码行数:31,代码来源:iblock_list_admin.php

示例6: getRatio

function getRatio($arBasketItems)
{
    if (Loader::includeModule('catalog')) {
        $map = array();
        $arElementId = array();
        foreach ($arBasketItems as $key => $arItem) {
            $arElementId[$arItem["PRODUCT_ID"]] = $arItem["PRODUCT_ID"];
            if (!isset($map[$arItem["PRODUCT_ID"]])) {
                $map[$arItem["PRODUCT_ID"]] = array();
            }
            $map[$arItem["PRODUCT_ID"]][] = $key;
        }
        if (!empty($arElementId)) {
            $dbRatio = CCatalogMeasureRatio::getList(array(), array('PRODUCT_ID' => $arElementId), false, false, array('PRODUCT_ID', 'RATIO'));
            while ($arRatio = $dbRatio->Fetch()) {
                if (empty($map[$arRatio["PRODUCT_ID"]])) {
                    continue;
                }
                foreach ($map[$arRatio["PRODUCT_ID"]] as $key) {
                    $arBasketItems[$key]["MEASURE_RATIO"] = $arRatio["RATIO"];
                }
            }
        }
        unset($arElementId, $map);
    }
    return $arBasketItems;
}
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:27,代码来源:include.php

示例7: doubleval

                        $strError = "Не все модификаторы товара, добавляемые в корзину, заполнены";
                        $successfulAdd = false;
                    }
                }

                if (isset($_REQUEST[$arParams["PRODUCT_QUANTITY_VARIABLE"]]))
                {
                    $QUANTITY = doubleval($_REQUEST[$arParams["PRODUCT_QUANTITY_VARIABLE"]]);
                }

                if (!$QUANTITY)
                {
                    $rsRatios = CCatalogMeasureRatio::getList(
                        array(),
                        array('PRODUCT_ID' => $productID),
                        false,
                        false,
                        array('PRODUCT_ID', 'RATIO')
                    );
                    if ($arRatio = $rsRatios->Fetch())
                    {
                        $intRatio = (int) $arRatio['RATIO'];
                        $dblRatio = doubleval($arRatio['RATIO']);
                        $QUANTITY = ($dblRatio > $intRatio ? $dblRatio : $intRatio);
                    }
                }

                if (!$QUANTITY)
                {
                    $QUANTITY = 1;
                }
开发者ID:phwb,项目名称:ugraweb.iiko,代码行数:31,代码来源:basket_add.php

示例8: GetOffersArray


//.........这里部分代码省略.........
				}

				if($element_id > 0)
				{
					$arOffer["LINK_ELEMENT_ID"] = intval($element_id);
					$arOffer["PROPERTIES"] = array();
					$arOffer["DISPLAY_PROPERTIES"] = array();

					$arOffer['CHECK_QUANTITY'] = ('Y' == $arOffer['CATALOG_QUANTITY_TRACE'] && 'N' == $arOffer['CATALOG_CAN_BUY_ZERO']);
					$arOffer['CATALOG_TYPE'] = CCatalogProduct::TYPE_OFFER;
					$arOffer['CATALOG_MEASURE_NAME'] = $arDefaultMeasure['SYMBOL_RUS'];
					$arOffer['~CATALOG_MEASURE_NAME'] = $arDefaultMeasure['SYMBOL_RUS'];
					$arOffer["CATALOG_MEASURE_RATIO"] = 1;
					if (!isset($arOffer['CATALOG_MEASURE']))
						$arOffer['CATALOG_MEASURE'] = 0;
					$arOffer['CATALOG_MEASURE'] = intval($arOffer['CATALOG_MEASURE']);
					if (0 > $arOffer['CATALOG_MEASURE'])
						$arOffer['CATALOG_MEASURE'] = 0;
					if (0 < $arOffer['CATALOG_MEASURE'])
					{
						if (!isset($arMeasureMap[$arOffer['CATALOG_MEASURE']]))
							$arMeasureMap[$arOffer['CATALOG_MEASURE']] = array();
						$arMeasureMap[$arOffer['CATALOG_MEASURE']][] = $intKey;
					}

					$arOfferIDs[] = $arOffer['ID'];
					$arResult[$intKey] = $arOffer;
					$arOffersLink[$arOffer['ID']] = &$arResult[$intKey];
					$intKey++;
				}
			}
			if (!empty($arOfferIDs))
			{
				$rsRatios = CCatalogMeasureRatio::getList(
					array(),
					array('PRODUCT_ID' => $arOfferIDs),
					false,
					false,
					array('PRODUCT_ID', 'RATIO')
				);
				while ($arRatio = $rsRatios->Fetch())
				{
					$arRatio['PRODUCT_ID'] = intval($arRatio['PRODUCT_ID']);
					if (isset($arOffersLink[$arRatio['PRODUCT_ID']]))
					{
						$intRatio = intval($arRatio['RATIO']);
						$dblRatio = doubleval($arRatio['RATIO']);
						$mxRatio = ($dblRatio > $intRatio ? $dblRatio : $intRatio);
						if (CATALOG_VALUE_EPSILON > abs($mxRatio))
							$mxRatio = 1;
						elseif (0 > $mxRatio)
							$mxRatio = 1;
						$arOffersLink[$arRatio['PRODUCT_ID']]['CATALOG_MEASURE_RATIO'] = $mxRatio;
					}
				}

				if (!empty($arSelectProperties))
				{
					CIBlockElement::GetPropertyValuesArray($arOffersLink, $intOfferIBlockID, $arFilter);
					foreach ($arResult as &$arOffer)
					{
						CCatalogDiscount::SetProductPropertiesCache($arOffer['ID'], $arOffer["PROPERTIES"]);
						foreach ($arSelectProperties as $pid)
						{
							if (!isset($arOffer["PROPERTIES"][$pid]))
								continue;
开发者ID:ASDAFF,项目名称:open_bx,代码行数:67,代码来源:comp_pricetools.php

示例9: setItemsMeasure

 /**
  * Sets measure for all viewed products.
  * @return void
  */
 protected function setItemsMeasure()
 {
     if (!count($this->productIdsMap)) {
         return;
     }
     $measures = $this->data['MEASURE'];
     foreach ($this->items as &$item) {
         if (array_key_exists($item['CATALOG_MEASURE'], $measures)) {
             $measure = $measures[$item['CATALOG_MEASURE']];
             $item['~CATALOG_MEASURE_NAME'] = LANGUAGE_ID == "ru" ? $measure["SYMBOL_RUS"] : $measure["SYMBOL_INTL"];
             $item['CATALOG_MEASURE_NAME'] = String::htmlEncode($item['~CATALOG_MEASURE_NAME']);
         }
     }
     // Ratios
     $ratioIterator = CCatalogMeasureRatio::getList(array(), array('@PRODUCT_ID' => array_values($this->productIdsMap)), false, false, array('PRODUCT_ID', 'RATIO'));
     while ($ratio = $ratioIterator->fetch()) {
         if (isset($this->items[$ratio['PRODUCT_ID']])) {
             $intRatio = intval($ratio['RATIO']);
             $dblRatio = doubleval($ratio['RATIO']);
             $mxRatio = $dblRatio > $intRatio ? $dblRatio : $intRatio;
             if (CATALOG_VALUE_EPSILON > abs($mxRatio)) {
                 $mxRatio = 1;
             } elseif (0 > $mxRatio) {
                 $mxRatio = 1;
             }
             $this->items[$ratio['PRODUCT_ID']]['CATALOG_MEASURE_RATIO'] = $mxRatio;
         }
     }
 }
开发者ID:akniyev,项目名称:arteva.ru,代码行数:33,代码来源:class.php

示例10: GetOffersArray


//.........这里部分代码省略.........
                 $arOffer["DISPLAY_PROPERTIES"] = array();
                 $arOffer['CHECK_QUANTITY'] = 'Y' == $arOffer['CATALOG_QUANTITY_TRACE'] && 'N' == $arOffer['CATALOG_CAN_BUY_ZERO'];
                 $arOffer['CATALOG_TYPE'] = CCatalogProduct::TYPE_OFFER;
                 $arOffer['CATALOG_MEASURE_NAME'] = $arDefaultMeasure['SYMBOL_RUS'];
                 $arOffer['~CATALOG_MEASURE_NAME'] = $arDefaultMeasure['SYMBOL_RUS'];
                 $arOffer["CATALOG_MEASURE_RATIO"] = 1;
                 if (!isset($arOffer['CATALOG_MEASURE'])) {
                     $arOffer['CATALOG_MEASURE'] = 0;
                 }
                 $arOffer['CATALOG_MEASURE'] = (int) $arOffer['CATALOG_MEASURE'];
                 if (0 > $arOffer['CATALOG_MEASURE']) {
                     $arOffer['CATALOG_MEASURE'] = 0;
                 }
                 if (0 < $arOffer['CATALOG_MEASURE']) {
                     if (!isset($arMeasureMap[$arOffer['CATALOG_MEASURE']])) {
                         $arMeasureMap[$arOffer['CATALOG_MEASURE']] = array();
                     }
                     $arMeasureMap[$arOffer['CATALOG_MEASURE']][] = $intKey;
                 }
                 $arOfferIDs[] = $arOffer['ID'];
                 $arResult[$intKey] = $arOffer;
                 if (!isset($arOffersLink[$arOffer['ID']])) {
                     $arOffersLink[$arOffer['ID']] =& $arResult[$intKey];
                 } else {
                     if (!isset($extPrices[$arOffer['ID']])) {
                         $extPrices[$arOffer['ID']] = array();
                     }
                     $extPrices[$arOffer['ID']][] =& $arResult[$intKey];
                 }
                 $intKey++;
             }
         }
         if (!empty($arOfferIDs)) {
             $rsRatios = CCatalogMeasureRatio::getList(array(), array('@PRODUCT_ID' => $arOfferIDs), false, false, array('PRODUCT_ID', 'RATIO'));
             while ($arRatio = $rsRatios->Fetch()) {
                 $arRatio['PRODUCT_ID'] = (int) $arRatio['PRODUCT_ID'];
                 if (isset($arOffersLink[$arRatio['PRODUCT_ID']])) {
                     $intRatio = (int) $arRatio['RATIO'];
                     $dblRatio = (double) $arRatio['RATIO'];
                     $mxRatio = $dblRatio > $intRatio ? $dblRatio : $intRatio;
                     if (CATALOG_VALUE_EPSILON > abs($mxRatio)) {
                         $mxRatio = 1;
                     } elseif (0 > $mxRatio) {
                         $mxRatio = 1;
                     }
                     $arOffersLink[$arRatio['PRODUCT_ID']]['CATALOG_MEASURE_RATIO'] = $mxRatio;
                 }
             }
             if (!empty($arSelectProperties)) {
                 CIBlockElement::GetPropertyValuesArray($arOffersLink, $intOfferIBlockID, $arFilter);
                 foreach ($arResult as &$arOffer) {
                     if (self::$needDiscountCache) {
                         CCatalogDiscount::SetProductPropertiesCache($arOffer['ID'], $arOffer["PROPERTIES"]);
                     }
                     foreach ($arSelectProperties as $pid) {
                         if (!isset($arOffer["PROPERTIES"][$pid])) {
                             continue;
                         }
                         $prop =& $arOffer["PROPERTIES"][$pid];
                         $boolArr = is_array($prop["VALUE"]);
                         if ($boolArr && !empty($prop["VALUE"]) || !$boolArr && strlen($prop["VALUE"]) > 0) {
                             $arOffer["DISPLAY_PROPERTIES"][$pid] = CIBlockFormatProperties::GetDisplayValue($arOffer, $prop, "catalog_out");
                         }
                         unset($prop);
                     }
                 }
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:67,代码来源:comp_pricetools.php

示例11: getRatio

function getRatio($arBasketItems)
{
    if (Loader::includeModule('catalog')) {
        static $cacheRatio = array();
        $map = array();
        $arElementId = array();
        foreach ($arBasketItems as $key => $arItem) {
            $hash = md5((!empty($arItem['PRODUCT_PROVIDER_CLASS']) ? $arItem['PRODUCT_PROVIDER_CLASS'] : "") . "|" . (!empty($arItem['MODULE']) ? $arItem['MODULE'] : "") . "|" . $arItem["PRODUCT_ID"]);
            if (array_key_exists($hash, $cacheRatio)) {
                $arBasketItems[$key]["MEASURE_RATIO"] = $cacheRatio[$hash];
            } else {
                $arElementId[$arItem["PRODUCT_ID"]] = $arItem["PRODUCT_ID"];
            }
            if (!isset($map[$arItem["PRODUCT_ID"]])) {
                $map[$arItem["PRODUCT_ID"]] = array();
            }
            $map[$arItem["PRODUCT_ID"]][] = $key;
        }
        if (!empty($arElementId)) {
            $dbRatio = CCatalogMeasureRatio::getList(array(), array('@PRODUCT_ID' => $arElementId), false, false, array('PRODUCT_ID', 'RATIO'));
            while ($arRatio = $dbRatio->Fetch()) {
                if (empty($map[$arRatio["PRODUCT_ID"]])) {
                    continue;
                }
                foreach ($map[$arRatio["PRODUCT_ID"]] as $key) {
                    $arBasketItems[$key]["MEASURE_RATIO"] = $arRatio["RATIO"];
                    $itemData = $arBasketItems[$key];
                    $hash = md5((!empty($itemData['PRODUCT_PROVIDER_CLASS']) ? $itemData['PRODUCT_PROVIDER_CLASS'] : "") . "|" . (!empty($itemData['MODULE']) ? $itemData['MODULE'] : "") . "|" . $itemData["PRODUCT_ID"]);
                    $cacheRatio[$hash] = $arRatio["RATIO"];
                }
                unset($key);
            }
            unset($arRatio, $dbRatio);
        }
        unset($arElementId, $map);
    }
    return $arBasketItems;
}
开发者ID:akniyev,项目名称:itprom_dobrohost,代码行数:38,代码来源:include.php


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