• Модуль: calendar
  • Путь к файлу: ~/bitrix/modules/calendar/lib/sync/google/queuemanager.php
  • Класс: BitrixCalendarSyncGoogleQueueManager
  • Вызов: QueueManager::getEventsDb
static function getEventsDb(int $lastHandledId = 0)
{
	global $DB;

	return $DB->Query(
		"SELECT e.*, c.LAST_RESULT, s.GAPI_CALENDAR_ID, "
		. $DB->DateToCharFunction('e.DATE_FROM') . " as DATE_FROM, "
		. $DB->DateToCharFunction('e.DATE_TO') . " as DATE_TO, "
		. $DB->DateToCharFunction('e.ORIGINAL_DATE_FROM'). " as ORIGINAL_DATE_FROM, "
		. $DB->DateToCharFunction('e.DATE_CREATE'). " as DATE_CREATE, "
		. $DB->DateToCharFunction('e.TIMESTAMP_X'). " as TIMESTAMP_X"
		. " FROM b_calendar_event e"
		. " INNER JOIN b_calendar_section s ON e.SECTION_ID = s.ID"
		. " INNER JOIN b_dav_connections c ON c.ID = s.CAL_DAV_CON"
		. " WHERE e.SYNC_STATUS <> 'success'"
			. " AND e.ID > ".$lastHandledId
			. " AND s.EXTERNAL_TYPE IN ('local', 'google')"
		. " ORDER BY e.ID ASC"
		. " LIMIT 10"
		. ";"
	);
}