• Модуль: timeman
  • Путь к файлу: ~/bitrix/modules/timeman/lib/monitor/history/absence.php
  • Класс: BitrixTimemanMonitorHistoryAbsence
  • Вызов: Absence::remove
static function remove(int $userId, string $dateLog, string $desktopCode): Result
{
	$connection = Application::getConnection();
	$sqlHelper = $connection->getSqlHelper();

	$dateLog = $sqlHelper->forSql($dateLog);
	$desktopCode = $sqlHelper->forSql($desktopCode);

	$deleteAbsenceQuery = "
		DELETE tma FROM b_timeman_monitor_absence tma WHERE tma.USER_LOG_ID IN (
			SELECT ID
			FROM b_timeman_monitor_user_log
			WHERE DATE_LOG = '{$dateLog}'
				and USER_ID = {$userId}
				and DESKTOP_CODE = '{$desktopCode}'
		);
	";

	return $connection->query($deleteAbsenceQuery);
}