當前位置: 首頁>>代碼示例>>PHP>>正文


PHP CurrencyManager::getDatetimeExpressionTemplate方法代碼示例

本文整理匯總了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;
 }
開發者ID:akniyev,項目名稱:itprom_dobrohost,代碼行數:40,代碼來源:currency.php


注:本文中的Bitrix\Currency\CurrencyManager::getDatetimeExpressionTemplate方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。