• Модуль: calendar
  • Путь к файлу: ~/bitrix/modules/calendar/lib/update/correcteventingoogle.php
  • Класс: BitrixCalendarUpdateCorrectEventInGoogle
  • Вызов: CorrectEventInGoogle::getLocalEventWronglySent
private function getLocalEventWronglySent(): array
{
	global $DB;

	$events = [];
	$strSql = "SELECT"
			. " e.ID as ID,"
			. " e.G_EVENT_ID as G_EVENT_ID,"
			. " e.OWNER_ID as OWNER_ID,"
			. " s.GAPI_CALENDAR_ID as GAPI_CALENDAR_ID,"
			. " c.ID as CONNECTION_ID,"
			. " s.ID as SECTION_ID"
		. " FROM b_calendar_event e"
		. " INNER JOIN b_calendar_section s"
			. " ON e.SECTION_ID = s.ID"
		. " INNER JOIN b_dav_connections c"
			. " ON s.CAL_DAV_CON = c.ID"
		. " WHERE"
			. " e.MEETING_STATUS = 'N'"
			. " AND e.G_EVENT_ID IS NOT NULL"
			. " AND e.DATE_TO_TS_UTC >= " . $this->getSyncTimestamp()
			. " AND e.SYNC_STATUS != '" . Dictionary::SYNC_STATUS['deleted'] . "'"
			. " AND s.GAPI_CALENDAR_ID IS NOT NULL"
			. " AND s.CAL_DAV_CON IS NOT NULL"
			. " AND s.EXTERNAL_TYPE = 'local'"
		. " LIMIT 10"
		. ";"
	;

	$eventsDb = $DB->Query($strSql);
	while ($event = $eventsDb->Fetch())
	{
		$events[] = $event;
	}

	return $events;
}