- Модуль: perfmon
- Путь к файлу: ~/bitrix/modules/perfmon/classes/general/index_complete.php
- Класс: CPerfomanceIndexComplete
- Вызов: CPerfomanceIndexComplete::GetList
static function GetList($arFilter = array(), $arOrder = array())
{
global $DB;
if (!is_array($arOrder))
$arOrder = array();
if (count($arOrder) < 1)
$arOrder = array(
"TABLE_NAME" => "ASC",
);
$arQueryOrder = array();
foreach ($arOrder as $strColumn => $strDirection)
{
$strColumn = mb_strtoupper($strColumn);
$strDirection = mb_strtoupper($strDirection) == "ASC"? "ASC": "DESC";
switch ($strColumn)
{
case "ID":
case "TABLE_NAME":
$arSelect[] = $strColumn;
$arQueryOrder[$strColumn] = $strColumn." ".$strDirection;
break;
}
}
$obQueryWhere = new CSQLWhere;
$obQueryWhere->SetFields(array(
"ID" => array(
"TABLE_ALIAS" => "s",
"FIELD_NAME" => "ID",
"FIELD_TYPE" => "int", //int, double, file, enum, int, string, date, datetime
"JOIN" => false,
//"LEFT_JOIN" => "lt",
),
));
if (!is_array($arFilter))
$arFilter = array();
$strQueryWhere = $obQueryWhere->GetQuery($arFilter);
$strSql = "
SELECT *
FROM b_perf_index_complete s
".($strQueryWhere? "WHERE ".$strQueryWhere: "")."
".(count($arQueryOrder)? "ORDER BY ".implode(", ", $arQueryOrder): "")."
";
$res = $DB->Query($strSql, false, "File: ".__FILE__."
Line: ".__LINE__);
return $res;
}