• Модуль: voximplant
  • Путь к файлу: ~/bitrix/modules/voximplant/lib/integration/report/handler/callactivity/callactivitygraph.php
  • Класс: BitrixVoximplantIntegrationReportHandlerCallActivityCallActivityGraph
  • Вызов: CallActivityGraph::getWorkTimesOfNumbers
private function getWorkTimesOfNumbers(): array
{
	$query = ConfigTable::query();
	$query->setSelect([
		'TIMEZONE' => 'WORKTIME_TIMEZONE',
		'FROM' => 'WORKTIME_FROM',
		'TO' => 'WORKTIME_TO',
		'PORTAL_NUMBER' => 'number.NUMBER',
		'SIP_NUMBER' => 'SEARCH_ID'
	]);

	$query->registerRuntimeField(new ReferenceField(
		'number',
		NumberTable::getEntity(),
		Join::on('this.ID', 'ref.CONFIG_ID')
	));

	$query->registerRuntimeField(new ReferenceField(
		'sip',
		SipTable::getEntity(),
		Join::on('this.ID', 'ref.CONFIG_ID')
	));

	$query->where('WORKTIME_ENABLE', '=', 'Y');

	$portalNumbers = $this->getFilterParameters()['PORTAL_NUMBER'];
	if ($portalNumbers)
	{
		$query->where(Query::filter()
				->logic('or')
				->whereIn('PORTAL_NUMBER', $portalNumbers)
				->whereIn('SIP_NUMBER', $portalNumbers)
		);
	}

	return $query->exec()->fetchAll();
}