• Модуль: statistic
  • Путь к файлу: ~/bitrix/modules/statistic/classes/mysql/useronline.php
  • Класс: CUserOnline
  • Вызов: CUserOnline::GetGuestCount
static function GetGuestCount()
{
	$DB = CDatabase::GetModuleConnection('statistic');
	$err_mess = "File: ".__FILE__."
Line: "; $interval = intval(COption::GetOptionString("statistic", "ONLINE_INTERVAL")); $strSql = " SELECT count(distinct G.ID) CNT FROM b_stat_session S INNER JOIN b_stat_guest G ON (G.ID = S.GUEST_ID) WHERE S.DATE_STAT = curdate() and S.DATE_LAST > DATE_ADD(now(), INTERVAL - $interval SECOND) "; $rs = $DB->Query($strSql, false, $err_mess.__LINE__); $ar = $rs->Fetch(); return intval($ar["CNT"]); }