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


PHP CPrice::getListEx方法代码示例

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


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

示例1: loadFromDatabase

 protected function loadFromDatabase()
 {
     if (!isset($this->fields)) {
         $pricesList = \CPrice::getListEx(array(), array("=PRODUCT_ID" => $this->id, "+<=QUANTITY_FROM" => 1, "+>=QUANTITY_TO" => 1), false, false, array("PRICE", "CURRENCY", "CATALOG_GROUP_ID", "CATALOG_GROUP_CODE"));
         $this->fields = array();
         while ($priceInfo = $pricesList->fetch()) {
             $price_id = $priceInfo["CATALOG_GROUP_ID"];
             $price = \FormatCurrency($priceInfo["PRICE"], $priceInfo["CURRENCY"]);
             $this->addField($price_id, $price_id, $price);
             $this->addField($priceInfo["CATALOG_GROUP_CODE"], $price_id, $price);
         }
     }
     return is_array($this->fields);
 }
开发者ID:ASDAFF,项目名称:open_bx,代码行数:14,代码来源:elementprice.php

示例2: loadElementPrices

 /**
  * Fills member elementPrices member with prices.
  *
  * @param integer[] $productList Identifiers of the elements.
  *
  * @return void
  */
 protected function loadElementPrices(array $productList)
 {
     $priceList = \CPrice::getListEx(array(), array('PRODUCT_ID' => $productList), false, false, array('ID', 'PRODUCT_ID', 'CATALOG_GROUP_ID', 'PRICE', 'CURRENCY', 'QUANTITY_FROM', 'QUANTITY_TO'));
     while ($price = $priceList->fetch()) {
         if (!isset($this->elementPrices[$price["CATALOG_GROUP_ID"]][$price["CURRENCY"]])) {
             $this->elementPrices[$price["CATALOG_GROUP_ID"]][$price["CURRENCY"]] = array();
         }
         $priceValue = doubleval($price["PRICE"]);
         $this->elementPrices[$price["CATALOG_GROUP_ID"]][$price["CURRENCY"]][$priceValue] = $priceValue;
     }
     foreach ($this->elementPrices as $catalogGroupId => $currencyPrices) {
         foreach ($currencyPrices as $currency => $prices) {
             if (count($prices) > 2) {
                 $this->elementPrices[$catalogGroupId][$currency] = array(min($prices), max($prices));
             }
         }
     }
 }
开发者ID:mrdeadmouse,项目名称:u136006,代码行数:25,代码来源:element.php

示例3: getSkuPrices

 protected function getSkuPrices()
 {
     $result = array();
     if ($this->offers) {
         $ids = array();
         foreach ($this->offers as $id => $offers) {
             foreach ($offers as $offer) {
                 $ids[] = $offer['ID'];
             }
         }
         if ($ids) {
             $priceIds = $this->getVisiblePrices();
             foreach ($priceIds as $id) {
                 $dbPrice = \CPrice::getListEx(array(), array('PRODUCT_ID' => $ids, 'CATALOG_GROUP_ID' => $id), 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($result[$id][$arPrice["PRODUCT_ID"]]) || $result[$id][$arPrice["PRODUCT_ID"]]['QUANTITY_FROM'] > $arPrice['QUANTITY_FROM']) {
                         $result[$id][$arPrice["PRODUCT_ID"]] = array('PRICE' => $arPrice['PRICE'], 'CURRENCY' => $arPrice['CURRENCY'], 'QUANTITY_FROM' => $arPrice['QUANTITY_FROM'], 'QUANTITY_TO' => $arPrice['QUANTITY_TO']);
                     }
                 }
                 unset($arPrice, $dbPrice);
             }
         }
     }
     return $result;
 }
开发者ID:Satariall,项目名称:izurit,代码行数:27,代码来源:class.php

示例4: loadElementPrices

 /**
  * Fills member elementPrices member with prices.
  *
  * @param integer[] $productList Identifiers of the elements.
  *
  * @return void
  */
 protected function loadElementPrices(array $productList)
 {
     $priceList = \CPrice::getListEx(array(), array('PRODUCT_ID' => $productList), false, false, array('ID', 'PRODUCT_ID', 'CATALOG_GROUP_ID', 'PRICE', 'CURRENCY', 'QUANTITY_FROM', 'QUANTITY_TO'));
     while ($price = $priceList->fetch()) {
         if (!$price["QUANTITY_FROM"] && !$price["QUANTITY_TO"]) {
             if (!isset($this->elementPrices[$price["CATALOG_GROUP_ID"]][$price["CURRENCY"]])) {
                 $this->elementPrices[$price["CATALOG_GROUP_ID"]][$price["CURRENCY"]] = array();
             }
             $this->elementPrices[$price["CATALOG_GROUP_ID"]][$price["CURRENCY"]][] = $price["PRICE"];
         }
     }
 }
开发者ID:ASDAFF,项目名称:1C_Bitrix_info_site,代码行数:19,代码来源:element.php


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