本文整理匯總了PHP中Bitrix\Currency\CurrencyManager::getDatetimeExpressionTemplate方法的典型用法代碼示例。如果您正苦於以下問題:PHP CurrencyManager::getDatetimeExpressionTemplate方法的具體用法?PHP CurrencyManager::getDatetimeExpressionTemplate怎麽用?PHP CurrencyManager::getDatetimeExpressionTemplate使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Bitrix\Currency\CurrencyManager
的用法示例。
在下文中一共展示了CurrencyManager::getDatetimeExpressionTemplate方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: __GetList
public static function __GetList(&$by, &$order, $lang = LANGUAGE_ID)
{
$lang = substr((string) $lang, 0, 2);
$normalBy = strtolower($by);
if ($normalBy != 'currency' && $normalBy != 'name') {
$normalBy = 'sort';
$by = 'sort';
}
$normalOrder = strtoupper($order);
if ($normalOrder != 'DESC') {
$normalOrder = 'ASC';
$order = 'asc';
}
switch ($normalBy) {
case 'currency':
$currencyOrder = array('CURRENCY' => $normalOrder);
break;
case 'name':
$currencyOrder = array('FULL_NAME' => $normalOrder);
break;
case 'sort':
default:
$currencyOrder = array('SORT' => $normalOrder);
break;
}
unset($normalOrder, $normalBy);
$datetimeField = Currency\CurrencyManager::getDatetimeExpressionTemplate();
$currencyIterator = Currency\CurrencyTable::getList(array('select' => array('CURRENCY', 'AMOUNT_CNT', 'AMOUNT', 'SORT', 'BASE', 'NUMCODE', 'CREATED_BY', 'MODIFIED_BY', new Main\Entity\ExpressionField('DATE_UPDATE_FORMAT', $datetimeField, array('DATE_UPDATE'), array('data_type' => 'datetime')), new Main\Entity\ExpressionField('DATE_CREATE_FORMAT', $datetimeField, array('DATE_CREATE'), array('data_type' => 'datetime')), 'FULL_NAME' => 'RT_LANG.FULL_NAME', 'LID' => 'RT_LANG.LID', 'FORMAT_STRING' => 'RT_LANG.FORMAT_STRING', 'DEC_POINT' => 'RT_LANG.DEC_POINT', 'THOUSANDS_SEP' => 'RT_LANG.THOUSANDS_SEP', 'DECIMALS' => 'RT_LANG.DECIMALS', 'HIDE_ZERO' => 'RT_LANG.HIDE_ZERO'), 'order' => $currencyOrder, 'runtime' => array('RT_LANG' => array('data_type' => 'Bitrix\\Currency\\CurrencyLang', 'reference' => array('=this.CURRENCY' => 'ref.CURRENCY', '=ref.LID' => new Main\DB\SqlExpression('?', $lang))))));
unset($datetimeField);
$currencyList = array();
while ($currency = $currencyIterator->fetch()) {
$currency['DATE_UPDATE'] = $currency['DATE_UPDATE_FORMAT'];
$currency['DATE_CREATE'] = $currency['DATE_CREATE_FORMAT'];
$currencyList[] = $currency;
}
unset($currency, $currencyIterator);
$result = new CDBResult();
$result->InitFromArray($currencyList);
return $result;
}