• Модуль: calendar
  • Путь к файлу: ~/bitrix/modules/calendar/lib/update/locationduplicatecleaner.php
  • Класс: BitrixCalendarUpdateLocationDuplicateCleaner
  • Вызов: LocationDuplicateCleaner::getEntryDataToClean
private function getEntryDataToClean(): ?array
{
	global $DB;
	$strSql = "select
			MAX(ID) as LASTID,
			PARENT_ID, 
			COUNT(1) as CNT
		from 
			b_calendar_event 
		where 
			CAL_TYPE='location'
		group by 
			PARENT_ID
		having CNT > 1
		order by ID desc
		limit 1";

	$res = $DB->Query($strSql);
	if ($entry = $res->Fetch())
	{
		return $entry;
	}
	return null;
}