本文整理汇总了PHP中Bitrix\Currency\CurrencyManager::getBaseCurrency方法的典型用法代码示例。如果您正苦于以下问题:PHP CurrencyManager::getBaseCurrency方法的具体用法?PHP CurrencyManager::getBaseCurrency怎么用?PHP CurrencyManager::getBaseCurrency使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Bitrix\Currency\CurrencyManager
的用法示例。
在下文中一共展示了CurrencyManager::getBaseCurrency方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: array
define('STOP_STATISTICS', true);
define('BX_SECURITY_SHOW_MESSAGE', true);
define('NO_AGENT_CHECK', true);
require_once $_SERVER['DOCUMENT_ROOT'] . '/bitrix/modules/main/include/prolog_admin_before.php';
header('Content-Type: application/x-javascript; charset=' . LANG_CHARSET);
Loc::loadMessages(__FILE__);
$result = array('STATUS' => '', 'MESSAGE' => '', 'RATE_CNT' => '', 'RATE' => '');
if (!check_bitrix_sessid()) {
$result['STATUS'] = 'ERROR';
$result['MESSAGE'] = Loc::getMessage('BX_CURRENCY_GET_RATE_ERR_SESSION');
} else {
if (!Loader::includeModule('currency')) {
$result['STATUS'] = 'ERROR';
$result['MESSAGE'] = Loc::getMessage('BX_CURRENCY_GET_RATE_ERR_MODULE_ABSENT');
} else {
$baseCurrency = Currency\CurrencyManager::getBaseCurrency();
$date = '';
$currency = '';
if (isset($_REQUEST['DATE_RATE'])) {
$date = (string) $_REQUEST['DATE_RATE'];
}
if (isset($_REQUEST['CURRENCY'])) {
$currency = (string) $_REQUEST['CURRENCY'];
}
if ($baseCurrency == '') {
$result['STATUS'] = 'ERROR';
$result['MESSAGE'] = Loc::getMessage('BX_CURRENCY_GET_RATE_ERR_BASE_CURRENCY_ABSENT');
} elseif ($date == '' || !$DB->IsDate($date)) {
$result['STATUS'] = 'ERROR';
$result['MESSAGE'] = Loc::getMessage('BX_CURRENCY_GET_RATE_ERR_DATE_RATE');
} elseif ($currency == '') {
示例2:
<tr>
<td width="30%" class="adm-detail-required-field"><?=Loc::getMessage('SEO_YANDEX_STATS_PERIOD')?>:</td>
<td width="70%">
<span style="white-space: nowrap; display:inline-block;"><select name="period_sel" onchange="setGraphInterval(this.value)">
<option value="interval"><?=Loc::getMessage('SEO_YANDEX_STATS_GRAPH_INTERVAL')?></option>
<option value="week_ago"><?=Loc::getMessage('SEO_YANDEX_STATS_GRAPH_WEEK')?></option>
<option value="month_ago"><?=Loc::getMessage('SEO_YANDEX_STATS_GRAPH_MONTH')?></option>
</select> <span id="seo_graph_interval"><?=CalendarDate("date_from", $dateStart->toString(), 'form1', "4")?> …<?=CalendarDate("date_to", $dateFinish->toString(), 'form1', "4")?></span></span> <input type="button" value="<?=Loc::getMessage('SEO_YANDEX_STATS_PERIOD_APPLY')?>" onclick="loadGraphData()" id="stats_loading_button" name="template_preview"><span id="stats_wait" class="loading-message-text" style="display: none; margin-top: 5px;"><?=Loc::getMessage('SEO_YANDEX_STATS_WAIT')?></span>
</td>
</tr>
<?
if($bSale):
?>
<tr>
<td><?=Loc::getMessage('SEO_YANDEX_STATS_SUM_ORDER_REPIOD')?>:</td>
<td><span id="banner_profit"><?=\CCurrencyLang::CurrencyFormat(doubleval($bannerProfit), \Bitrix\Currency\CurrencyManager::getBaseCurrency(), true)?></span></td>
</tr>
<?
endif;
?>
<tr>
<td><?=Loc::getMessage('SEO_YANDEX_STATS_GRAPH_TYPE')?>:</td>
<td><select onchange="setGraph(this.value)">
<option value="sum"><?=Loc::getMessage('SEO_YANDEX_STATS_GRAPH_TYPE_SUM')?></option>
<option value="shows"><?=Loc::getMessage('SEO_YANDEX_STATS_GRAPH_TYPE_SHOWS')?></option>
<option value="clicks"><?=Loc::getMessage('SEO_YANDEX_STATS_GRAPH_TYPE_CLICKS')?></option>
</select></td>
</tr>
<tr>
<td colspan="2">
<?
示例3: array
$arPrice = array();
if ($catalogIncluded) {
$arPrice = CCatalogIBlockParameters::getPriceTypesList();
}
$arProperty_UF = array();
$arSProperty_LNS = array();
if ($iblockExists) {
$arUserFields = $GLOBALS["USER_FIELD_MANAGER"]->GetUserFields("IBLOCK_" . $arCurrentValues["IBLOCK_ID"] . "_SECTION");
foreach ($arUserFields as $FIELD_NAME => $arUserField) {
$arProperty_UF[$FIELD_NAME] = $arUserField["LIST_COLUMN_LABEL"] ? $arUserField["LIST_COLUMN_LABEL"] : $FIELD_NAME;
if ($arUserField["USER_TYPE"]["BASE_TYPE"] == "string") {
$arSProperty_LNS[$FIELD_NAME] = $arProperty_UF[$FIELD_NAME];
}
}
unset($arUserFields, $FIELD_NAME, $arUserField);
}
$arComponentParameters = array("GROUPS" => array("PRICES" => array("NAME" => GetMessage("CP_BCSF_PRICES")), "XML_EXPORT" => array("NAME" => GetMessage("CP_BCSF_GROUP_XML_EXPORT"))), "PARAMETERS" => array("SEF_MODE" => array(), "SEF_RULE" => array("VALUES" => array("SECTION_ID" => array("TEXT" => GetMessage("CP_BCSF_SECTION_ID"), "TEMPLATE" => "#SECTION_ID#", "PARAMETER_LINK" => "SECTION_ID", "PARAMETER_VALUE" => '={$_REQUEST["SECTION_ID"]}'), "SECTION_CODE" => array("TEXT" => GetMessage("CP_BCSF_SECTION_CODE"), "TEMPLATE" => "#SECTION_CODE#", "PARAMETER_LINK" => "SECTION_CODE", "PARAMETER_VALUE" => '={$_REQUEST["SECTION_CODE"]}'), "SECTION_CODE_PATH" => array("TEXT" => GetMessage("CP_BCSF_SECTION_CODE_PATH"), "TEMPLATE" => "#SECTION_CODE_PATH#", "PARAMETER_LINK" => "SECTION_CODE_PATH", "PARAMETER_VALUE" => '={$_REQUEST["SECTION_CODE_PATH"]}'), "SMART_FILTER_PATH" => array("TEXT" => GetMessage("CP_BCSF_SMART_FILTER_PATH"), "TEMPLATE" => "#SMART_FILTER_PATH#", "PARAMETER_LINK" => "SMART_FILTER_PATH", "PARAMETER_VALUE" => '={$_REQUEST["SMART_FILTER_PATH"]}'))), "IBLOCK_TYPE" => array("PARENT" => "DATA_SOURCE", "NAME" => GetMessage("CP_BCSF_IBLOCK_TYPE"), "TYPE" => "LIST", "ADDITIONAL_VALUES" => "Y", "VALUES" => $arIBlockType, "REFRESH" => "Y"), "IBLOCK_ID" => array("PARENT" => "DATA_SOURCE", "NAME" => GetMessage("CP_BCSF_IBLOCK_ID"), "TYPE" => "LIST", "ADDITIONAL_VALUES" => "Y", "VALUES" => $arIBlock, "REFRESH" => "Y"), "SECTION_ID" => array("PARENT" => "DATA_SOURCE", "NAME" => GetMessage("CP_BCSF_SECTION_ID"), "TYPE" => "STRING", "DEFAULT" => '={$_REQUEST["SECTION_ID"]}'), "SECTION_CODE" => array("PARENT" => "DATA_SOURCE", "NAME" => GetMessage("CP_BCSF_SECTION_CODE"), "TYPE" => "STRING", "DEFAULT" => ''), "FILTER_NAME" => array("PARENT" => "DATA_SOURCE", "NAME" => GetMessage("CP_BCSF_FILTER_NAME"), "TYPE" => "STRING", "DEFAULT" => "arrFilter"), "PRICE_CODE" => array("PARENT" => "PRICES", "NAME" => GetMessage("CP_BCSF_PRICE_CODE"), "TYPE" => "LIST", "MULTIPLE" => "Y", "VALUES" => $arPrice), "CACHE_TIME" => array("DEFAULT" => 36000000), "CACHE_GROUPS" => array("PARENT" => "CACHE_SETTINGS", "NAME" => GetMessage("CP_BCSF_CACHE_GROUPS"), "TYPE" => "CHECKBOX", "DEFAULT" => "Y"), "SAVE_IN_SESSION" => array("PARENT" => "ADDITIONAL_SETTINGS", "NAME" => GetMessage("CP_BCSF_SAVE_IN_SESSION"), "TYPE" => "CHECKBOX", "DEFAULT" => "N"), "INSTANT_RELOAD" => array("PARENT" => "ADDITIONAL_SETTINGS", "NAME" => GetMessage("CP_BCSF_INSTANT_RELOAD"), "TYPE" => "CHECKBOX", "DEFAULT" => "N"), "XML_EXPORT" => array("PARENT" => "XML_EXPORT", "NAME" => GetMessage("CP_BCSF_XML_EXPORT"), "TYPE" => "CHECKBOX", "DEFAULT" => "N"), "SECTION_TITLE" => array("PARENT" => "XML_EXPORT", "NAME" => GetMessage("CP_BCSF_SECTION_TITLE"), "TYPE" => "LIST", "MULTIPLE" => "N", "DEFAULT" => "-", "VALUES" => array_merge(array("-" => " ", "NAME" => GetMessage("IBLOCK_FIELD_NAME")), $arSProperty_LNS)), "SECTION_DESCRIPTION" => array("PARENT" => "XML_EXPORT", "NAME" => GetMessage("CP_BCSF_SECTION_DESCRIPTION"), "TYPE" => "LIST", "MULTIPLE" => "N", "DEFAULT" => "-", "VALUES" => array_merge(array("-" => " ", "NAME" => GetMessage("IBLOCK_FIELD_NAME"), "DESCRIPTION" => GetMessage("IBLOCK_FIELD_DESCRIPTION")), $arSProperty_LNS))));
if ($arCurrentValues["SEF_MODE"] == "Y") {
$arComponentParameters["PARAMETERS"]["SECTION_CODE_PATH"] = array("NAME" => GetMessage("CP_BCSF_SECTION_CODE_PATH"), "TYPE" => "STRING", "DEFAULT" => "");
$arComponentParameters["PARAMETERS"]["SMART_FILTER_PATH"] = array("NAME" => GetMessage("CP_BCSF_SMART_FILTER_PATH"), "TYPE" => "STRING", "DEFAULT" => "");
}
if ($catalogIncluded) {
$arComponentParameters["PARAMETERS"]['HIDE_NOT_AVAILABLE'] = array('PARENT' => 'DATA_SOURCE', 'NAME' => GetMessage('CP_BCSF_HIDE_NOT_AVAILABLE'), 'TYPE' => 'CHECKBOX', 'DEFAULT' => 'N');
$arComponentParameters["PARAMETERS"]['CONVERT_CURRENCY'] = array('PARENT' => 'PRICES', 'NAME' => GetMessage('CP_BCSF_CONVERT_CURRENCY'), 'TYPE' => 'CHECKBOX', 'DEFAULT' => 'N', 'REFRESH' => 'Y');
if (isset($arCurrentValues['CONVERT_CURRENCY']) && $arCurrentValues['CONVERT_CURRENCY'] == 'Y') {
$arComponentParameters['PARAMETERS']['CURRENCY_ID'] = array('PARENT' => 'PRICES', 'NAME' => GetMessage('CP_BCSF_CURRENCY_ID'), 'TYPE' => 'LIST', 'VALUES' => Currency\CurrencyManager::getCurrencyList(), 'DEFAULT' => Currency\CurrencyManager::getBaseCurrency(), "ADDITIONAL_VALUES" => "Y");
}
}
if (empty($arPrice)) {
unset($arComponentParameters["PARAMETERS"]["PRICE_CODE"]);
}
示例4: array
$arComponentParameters["PARAMETERS"]['CONVERT_CURRENCY'] = array(
'PARENT' => 'PRICES',
'NAME' => GetMessage('CP_BCS_CONVERT_CURRENCY'),
'TYPE' => 'CHECKBOX',
'DEFAULT' => 'N',
'REFRESH' => 'Y',
);
if (isset($arCurrentValues['CONVERT_CURRENCY']) && $arCurrentValues['CONVERT_CURRENCY'] == 'Y')
{
$arComponentParameters['PARAMETERS']['CURRENCY_ID'] = array(
'PARENT' => 'PRICES',
'NAME' => GetMessage('CP_BCS_CURRENCY_ID'),
'TYPE' => 'LIST',
'VALUES' => Currency\CurrencyManager::getCurrencyList(),
'DEFAULT' => Currency\CurrencyManager::getBaseCurrency(),
"ADDITIONAL_VALUES" => "Y",
);
}
}
if (empty($offers))
{
unset($arComponentParameters["PARAMETERS"]["OFFERS_FIELD_CODE"]);
unset($arComponentParameters["PARAMETERS"]["OFFERS_PROPERTY_CODE"]);
unset($arComponentParameters["PARAMETERS"]["OFFERS_SORT_FIELD"]);
unset($arComponentParameters["PARAMETERS"]["OFFERS_SORT_ORDER"]);
unset($arComponentParameters["PARAMETERS"]["OFFERS_SORT_FIELD2"]);
unset($arComponentParameters["PARAMETERS"]["OFFERS_SORT_ORDER2"]);
}
else
示例5: updateBaseRates
protected static function updateBaseRates($currency = '', $updateCurrency = '')
{
global $DB;
if ($currency === '') {
$currency = (string) Currency\CurrencyManager::getBaseCurrency();
}
if ($currency === '') {
return;
}
if ($updateCurrency != '') {
$factor = 1;
if ($updateCurrency != $currency) {
$factor = CCurrencyRates::GetConvertFactor($updateCurrency, $currency);
}
$query = "update b_catalog_currency set CURRENT_BASE_RATE = " . (double) $factor . " where CURRENCY = '" . $updateCurrency . "'";
$DB->Query($query, false, 'File: ' . __FILE__ . '<br>Line: ' . __LINE__);
} else {
$query = "select CURRENCY from b_catalog_currency";
$currencyIterator = $DB->Query($query, false, 'File: ' . __FILE__ . '<br>Line: ' . __LINE__);
while ($oneCurrency = $currencyIterator->Fetch()) {
$factor = 1;
if ($oneCurrency['CURRENCY'] != $currency) {
$factor = CCurrencyRates::GetConvertFactor($oneCurrency['CURRENCY'], $currency);
}
$query = "update b_catalog_currency set CURRENT_BASE_RATE = " . (double) $factor . " where CURRENCY = '" . $oneCurrency['CURRENCY'] . "'";
$DB->Query($query, false, 'File: ' . __FILE__ . '<br>Line: ' . __LINE__);
}
}
}
示例6: GetBaseCurrency
public static function GetBaseCurrency()
{
return Currency\CurrencyManager::getBaseCurrency();
}
示例7: getProductData
/**
* @param Basket $basketCollection
* @param array $select
* @param BasketItem $refreshItem
* @return array
* @throws NotSupportedException
*/
public static function getProductData(Basket $basketCollection, array $select = array(), BasketItem $refreshItem = null)
{
$result = array();
$orderId = null;
$userId = null;
$siteId = null;
$currency = null;
if (($order = $basketCollection->getOrder()) !== null) {
$userId = $order->getUserId();
$siteId = $order->getSiteId();
$currency = $order->getCurrency();
}
if ($userId === null) {
static $usersIds = array();
if (empty($usersIds[$basketCollection->getFUserId(true)])) {
$usersIds[$basketCollection->getFUserId(true)] = \CSaleUser::getUserID($basketCollection->getFUserId(true));
}
$userId = $usersIds[$basketCollection->getFUserId(true)];
}
if ($siteId === null) {
$siteId = $basketCollection->getSiteId();
}
if ($siteId === null) {
return array();
}
if ($currency === null) {
$currency = Internals\SiteCurrencyTable::getSiteCurrency($siteId);
if (!$currency) {
$currency = Currency\CurrencyManager::getBaseCurrency();
}
}
$basketList = static::makeArrayFromBasketCollection($basketCollection, $refreshItem);
$basketProviderMap = static::createProviderBasketMap($basketList, array('QUANTITY', 'RENEWAL'));
$basketProviderList = static::redistributeToProviders($basketProviderMap);
if (!empty($basketProviderList)) {
$needPrice = in_array('PRICE', $select);
$needBasePrice = in_array('BASE_PRICE', $select);
$needCoupons = in_array('COUPONS', $select);
$data = array('USER_ID' => (int) $userId, 'SITE_ID' => $siteId, 'CURRENCY' => $currency, 'CHECK_QUANTITY' => in_array('QUANTITY', $select) ? 'Y' : 'N', 'CHECK_PRICE' => $needPrice ? 'Y' : 'N', 'CHECK_COUPONS' => $needCoupons ? 'Y' : 'N', 'RENEWAL' => in_array('RENEWAL', $select) ? 'Y' : 'N');
if ($needBasePrice) {
$data['CHECK_DISCOUNT'] = 'N';
}
$useOrderProduct = false;
if ($needPrice) {
$useOrderProduct = true;
}
if ($needCoupons) {
$useOrderProduct = false;
}
unset($needCoupons, $needPrice);
foreach ($basketProviderList as $provider => $providerBasketItemList) {
if ($provider instanceof Provider) {
throw new NotSupportedException('provider not supported');
} elseif ($provider && array_key_exists("IBXSaleProductProvider", class_implements($provider))) {
foreach ($providerBasketItemList as $providerBasketItem) {
$currentUseOrderProduct = $useOrderProduct;
if (!isset($providerBasketItem['BASKET_ID']) || (int) $providerBasketItem['BASKET_ID'] <= 0) {
$currentUseOrderProduct = false;
}
$providerFields = $data;
if ($providerBasketItem['BASKET_ITEM']->isBundleChild()) {
$providerFields['CHECK_DISCOUNT'] = 'N';
}
$providerFields['PRODUCT_ID'] = $providerBasketItem['PRODUCT_ID'];
$providerFields['QUANTITY'] = $providerBasketItem['QUANTITY'];
$hasTrustData = false;
$trustData = static::getTrustData($siteId, $providerBasketItem['MODULE'], $providerBasketItem['PRODUCT_ID']);
if (static::isReadTrustData() === true && !empty($trustData) && is_array($trustData)) {
$hasTrustData = true;
$resultProductData = $trustData;
foreach (static::getProductDataRequiredFields() as $requiredField) {
if (!array_key_exists($requiredField, $resultProductData)) {
$hasTrustData = false;
break;
}
}
if ($hasTrustData && in_array('PRICE', $select)) {
foreach (static::getProductDataRequiredPriceFields() as $requiredField) {
if (!array_key_exists($requiredField, $resultProductData)) {
$hasTrustData = false;
break;
}
}
}
}
if (!$hasTrustData) {
$resultProductData = $currentUseOrderProduct ? $provider::OrderProduct($providerFields) : $provider::GetProductData($providerFields);
}
$basketCode = $providerBasketItem['BASKET_ITEM']->getBasketCode();
$result[$basketCode] = $resultProductData;
}
} else {
foreach ($providerBasketItemList as $providerBasketItem) {
//.........这里部分代码省略.........
示例8: array
fwrite($fp, '<platform>1C-Bitrix</platform>'."\n");
$strTmp = '<currencies>'."\n";
$RUR = 'RUB';
$currencyIterator = Currency\CurrencyTable::getList(array(
'select' => array('CURRENCY'),
'filter' => array('=CURRENCY' => 'RUR')
));
if ($currency = $currencyIterator->fetch())
$RUR = 'RUR';
unset($currency, $currencyIterator);
$arCurrencyAllowed = array($RUR, 'USD', 'EUR', 'UAH', 'BYR', 'KZT');
$BASE_CURRENCY = Currency\CurrencyManager::getBaseCurrency();
if (is_array($XML_DATA['CURRENCY']))
{
foreach ($XML_DATA['CURRENCY'] as $CURRENCY => $arCurData)
{
if (in_array($CURRENCY, $arCurrencyAllowed))
{
$strTmp.= '<currency id="'.$CURRENCY.'"'
.' rate="'.($arCurData['rate'] == 'SITE' ? CCurrencyRates::ConvertCurrency(1, $CURRENCY, $RUR) : $arCurData['rate']).'"'
.($arCurData['plus'] > 0 ? ' plus="'.(int)$arCurData['plus'].'"' : '')
." />\n";
}
}
unset($CURRENCY, $arCurData);
}
else
示例9: array
"#ID#" => $banner["BANNER_ID"],
"#XML_ID#" => $banner["BANNER_XML_ID"],
)).'">'.Converter::getHtmlConverter()->encode($banner['BANNER_NAME']).'</a>');
$row->AddViewField('XML_ID', '<a href="https://direct.yandex.ru/registered/main.pl?cmd=showCampMultiEdit&bids='.$banner['BANNER_XML_ID'].'&cid='.$campaign['XML_ID'].'" target="_blank" title="'.Converter::getHtmlConverter()->encode(Loc::getMessage('SEO_CAMPAIGN_EDIT_EXTERNAL')).'">'.Loc::getMessage('SEO_YANDEX_DIRECT_LINK_TPL', array('#XML_ID#' => $banner['BANNER_XML_ID'])).'</a>');
$row->AddViewField("BANNER_SUM", number_format($banner['BANNER_SUM'], 2, '.', ' '));
$row->AddViewField("BANNER_SHOWS", $banner['BANNER_SHOWS']);
$row->AddViewField("BANNER_CLICKS", $banner['BANNER_CLICKS']);
$row->AddViewField("BANNER_CTR", number_format($banner['BANNER_CTR'], 2, '.', ' '));
if($bShowOrderStats)
{
$row->AddViewField("BANNER_SUM_ORDER", \CCurrencyLang::CurrencyFormat(doubleval($banner['BANNER_SUM_ORDER']), \Bitrix\Currency\CurrencyManager::getBaseCurrency(), true));
}
}
}
$statsAdminList->checkListMode();
}
if($ID <= 0)
{
$campaign = array(
"SETTINGS" => array(
"Name" => Loc::getMessage("SEO_CAMPAIGN_NAME_DEFAULT", array("#DATE#" => ConvertTimeStamp())),
"FIO" => $currentUser['real_name'],
"StartDate" => ConvertTimeStamp(),
"EmailNotification" => array(
示例10:
" onclick="loadGraphData()" id="stats_loading_button" name="template_preview"><span id="stats_wait" class="loading-message-text" style="display: none; margin-top: 5px;"><?php
echo Loc::getMessage('SEO_YANDEX_STATS_WAIT');
?>
</span>
</td>
</tr>
<?php
if ($bSale) {
?>
<tr>
<td><?php
echo Loc::getMessage('SEO_YANDEX_STATS_SUM_ORDER_REPIOD');
?>
:</td>
<td><span id="banner_profit"><?php
echo \CCurrencyLang::CurrencyFormat(doubleval($bannerProfit), \Bitrix\Currency\CurrencyManager::getBaseCurrency(), true);
?>
</span></td>
</tr>
<?php
}
?>
<tr>
<td><?php
echo Loc::getMessage('SEO_YANDEX_STATS_GRAPH_TYPE');
?>
:</td>
<td><select onchange="setGraph(this.value)">
<option value="sum"><?php
echo Loc::getMessage('SEO_YANDEX_STATS_GRAPH_TYPE_SUM');
?>
示例11: intval
}
$arParams["CACHE_TIME"] = intval($arParams["CACHE_TIME"]);
if ($this->StartResultCache()) {
if (!CModule::IncludeModule("currency")) {
$this->AbortResultCache();
ShowError(GetMessage("CURRENCY_MODULE_NOT_INSTALLED"));
return;
}
global $CACHE_MANAGER;
$arResult = array();
$arResult["CURRENCY"] = array();
if ('' == $arParams["CURRENCY_BASE"]) {
$arParams["CURRENCY_BASE"] = COption::GetOptionString("sale", "default_currency");
}
if ('' == $arParams["CURRENCY_BASE"]) {
$arParams["CURRENCY_BASE"] = Currency\CurrencyManager::getBaseCurrency();
}
if ('' != $arParams["CURRENCY_BASE"]) {
if ('' == $arParams["RATE_DAY"]) {
$arResult["RATE_DAY_TIMESTAMP"] = time();
$arResult["RATE_DAY_SHOW"] = ConvertTimeStamp($arResult["RATE_DAY_TIMESTAMP"], 'SHORT');
} else {
$arRATE_DAY_PARSED = ParseDateTime($arParams["RATE_DAY"], "YYYY-MM-DD");
$arRATE_DAY_PARSED['YYYY'] = intval($arRATE_DAY_PARSED['YYYY']);
if (1901 > $arRATE_DAY_PARSED["YYYY"] || 2038 < $arRATE_DAY_PARSED["YYYY"]) {
$arResult["RATE_DAY_TIMESTAMP"] = time();
$arResult["RATE_DAY_SHOW"] = ConvertTimeStamp($arResult["RATE_DAY_TIMESTAMP"], 'SHORT');
} else {
$arResult["RATE_DAY_TIMESTAMP"] = mktime(0, 0, 0, $arRATE_DAY_PARSED["MM"], $arRATE_DAY_PARSED["DD"], $arRATE_DAY_PARSED["YYYY"]);
$arResult["RATE_DAY_SHOW"] = ConvertTimeStamp($arResult["RATE_DAY_TIMESTAMP"], 'SHORT');
}
示例12: unset
unset($dayData['BANNER_ID']);
unset($dayData['DATE_DAY']);
$dayData['date'] = $date;
$graphData[] = $dayData;
}
$res["data"] = $graphData;
$res["date_from"] = $dateStart->toString();
$res["date_to"] = $dateFinish->toString();
if (\Bitrix\Main\ModuleManager::isModuleInstalled('sale') && \Bitrix\Main\ModuleManager::isModuleInstalled('catalog') && Loader::includeModule('currency')) {
$orderStats = Adv\OrderTable::getList(array('filter' => array('=BANNER_ID' => $bannerId, '=PROCESSED' => Adv\OrderTable::PROCESSED, ">=TIMESTAMP_X" => $dateStart, "<TIMESTAMP_X" => $dateFinish), 'group' => array('BANNER_ID'), 'select' => array('BANNER_SUM'), 'runtime' => array(new \Bitrix\Main\Entity\ExpressionField('BANNER_SUM', 'SUM(SUM)'))));
if ($stat = $orderStats->fetch()) {
$res["order_sum"] = $stat['BANNER_SUM'];
} else {
$res["order_sum"] = 0;
}
$res["order_sum_format"] = \CCurrencyLang::CurrencyFormat(doubleval($res["order_sum"]), \Bitrix\Currency\CurrencyManager::getBaseCurrency(), true);
}
}
} else {
$res = array("session" => $loadingSession, "amount" => $_SESSION[$loadingSession]['ORIGINAL_CNT'], "left" => count($_SESSION[$loadingSession]["GAPS"]));
}
break;
case 'campaign_stats':
$res = array();
$campaignId = intval($_REQUEST['campaign']);
$loadingSession = $_REQUEST['loading_session'];
$gaps = array();
if ($loadingSession) {
if (isset($_SESSION[$loadingSession]) && $_SESSION[$loadingSession]['CAMPAIGN_ID'] == $campaignId) {
$dateStart = new Date($_SESSION[$loadingSession]['DATE_START']);
$dateFinish = new Date($_SESSION[$loadingSession]['DATE_FINISH']);
示例13: getProductProfit
protected static function getProductProfit($productInfo)
{
if (strlen($productInfo['GROSS_PROFIT']) > 0) {
$profit = doubleval($productInfo['GROSS_PROFIT']);
} else {
$purchasingCost = 0;
if (strlen($productInfo['SUMMARY_PURCHASING_PRICE']) > 0) {
$purchasingCost = doubleval($productInfo['SUMMARY_PURCHASING_PRICE']);
} else {
$dbRes = ProductTable::getList(array('filter' => array('=ID' => $productInfo['PRODUCT_ID']), 'select' => array('ID', 'PURCHASING_PRICE', 'PURCHASING_CURRENCY')));
$productInfoBase = $dbRes->fetch();
if ($productInfoBase) {
$purchasingCost = $productInfoBase['PURCHASING_PRICE'] * $productInfo['QUANTITY'];
$baseCurrency = CurrencyManager::getBaseCurrency();
if ($baseCurrency != $productInfoBase['PURCHASING_CURRENCY']) {
$purchasingCost = \CCurrencyRates::convertCurrency($purchasingCost, $productInfoBase['PURCHASING_CURRENCY'], $baseCurrency);
}
}
}
$profit = doubleval($productInfo['SUMMARY_PRICE']) - $purchasingCost;
}
return $profit;
}
示例14: elseif
">
<div class="seo-adv-block-icon"></div>
<div class="seo-adv-block-title"><?php
echo $prefix;
echo \CCurrencyLang::CurrencyFormat($profit, CurrencyManager::getBaseCurrency(), true);
?>
</div>
<div class="seo-adv-block-text"><?php
echo Loc::getMessage('SEO_YANDEX_STATS_HINT_GROSS');
?>
</div>
</div>
<?php
$color = $expences > 0 ? 'red' : 'gray';
$prefix = $expences > 0 ? '– ' : '';
$text = CCurrencyLang::CurrencyFormat($expences, CurrencyManager::getBaseCurrency(), false);
if ($currency == '') {
$text .= ' ' . Loc::getMessage('SEO_YANDEX_CURRENCY');
} elseif (CurrencyManager::checkCurrencyID($currency)) {
$text = CCurrencyLang::CurrencyFormat($expences, $currency, true);
} else {
$text .= ' ' . $currency;
}
?>
<div class="seo-adv-block seo-adv-block-<?php
echo $color;
?>
">
<div class="seo-adv-block-icon"></div>
<div class="seo-adv-block-title"><?php
echo $prefix;
示例15: array
<?php
if (!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED !== true) {
die;
}
/** @var array $arCurrentValues */
use Bitrix\Main\Loader;
use Bitrix\Currency;
if (!Loader::includeModule('currency')) {
return;
}
$arComponentParameters = array("PARAMETERS" => array("arrCURRENCY_FROM" => array("NAME" => GetMessage("CURRENCY_FROM"), "TYPE" => "LIST", "MULTIPLE" => "Y", "ADDITIONAL_VALUES" => "N", "VALUES" => Currency\CurrencyManager::getCurrencyList(), "GROUP" => "BASE"), "CURRENCY_BASE" => array("NAME" => GetMessage("CURRENCY_BASE"), "TYPE" => "LIST", "MULTIPLE" => "N", "ADDITIONAL_VALUES" => "N", "VALUES" => Currency\CurrencyManager::getCurrencyList(), "DEFAULT" => Currency\CurrencyManager::getBaseCurrency(), "GROUP" => "BASE"), "RATE_DAY" => array("NAME" => GetMessage("CURRENCY_RATE_DAY"), "TYPE" => "STRING", "GROUP" => "ADDITIONAL_PARAMETERS"), "SHOW_CB" => array("NAME" => GetMessage("T_CURRENCY_CBRF"), "TYPE" => "CHECKBOX", "MULTIPLE" => "N", "DEFAULT" => "N", "ADDITIONAL_VALUES" => "N", "GROUP" => "ADDITIONAL_PARAMETERS"), "CACHE_TIME" => array("DEFAULT" => "86400")));