• Модуль: calendar
  • Путь к файлу: ~/bitrix/modules/calendar/lib/update/eventduplicatecleaner.php
  • Класс: BitrixCalendarUpdateEventDuplicateCleaner
  • Вызов: EventDuplicateCleaner::getDuplicatedChildEntryList
private function getDuplicatedChildEntryList(): ?array
{
	global $DB;
	$strSql = "select
			MAX(ID) as LASTID,
			MIN(ID) as FIRSTID,
			PARENT_ID, 
			OWNER_ID,
			COUNT(1) as CNT
		from 
			b_calendar_event 
		where 
			CAL_TYPE='user'
			and PARENT_ID is not null
		group by 
			PARENT_ID, OWNER_ID
		having CNT > 1
		order by ID desc
		limit 200";

	$entries = [];
	$res = $DB->Query($strSql);
	while ($entry = $res->Fetch())
	{
		$entries[] = $entry;
	}
	return $entries;
}