本文整理汇总了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;
}