• Модуль: landing
  • Путь к файлу: ~/bitrix/modules/landing/lib/landing/view.php
  • Класс: BitrixLandingLandingView
  • Вызов: View::getNumberUniqueViews
static function getNumberUniqueViews(int $lid): int
{
	$lid = (int)$lid;
	$res = ViewTable::getList([
		'select' => [
			'COUNT'
		],
		'filter' => [
			'LID' => $lid
		],
		'runtime' => [
			new EntityExpressionField(
				'COUNT', 'COUNT(*)'
			)
		]
	]);

	if ($row = $res->fetch())
	{
		$views = (int)$row['COUNT'];
	}

	if (isset($views) && is_int($views))
	{
		return $views;
	}

	return 0;
}