- Модуль: voximplant
- Путь к файлу: ~/bitrix/modules/voximplant/lib/integration/report/handler/callduration/callduration.php
- Класс: BitrixVoximplantIntegrationReportHandlerCallDurationCallDuration
- Вызов: CallDuration::prepare
public function prepare()
{
if (!$this->isCurrentUserHasAccess())
{
return [];
}
$filterParameters = $this->getFilterParameters();
$startDate = DateTime::createFromUserTime($filterParameters['TIME_PERIOD_from']);
$finishDate = DateTime::createFromUserTime($filterParameters['TIME_PERIOD_to']);
$previousPeriod = $this->getPreviousPeriod($startDate, $finishDate);
$previousStartDate = $previousPeriod['from'];
$previousFinishDate = $previousPeriod['to'];
$report = $this->getQueryForReport(
$startDate,
$finishDate,
$previousStartDate,
$previousFinishDate,
$filterParameters
)->exec()->fetchAll();
return [
'startDate' => $filterParameters['TIME_PERIOD_from'],
'finishDate' => $filterParameters['TIME_PERIOD_to'],
'report' => $report
];
}