當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。