• Модуль: crm
  • Путь к файлу: ~/bitrix/modules/crm/lib/integration/report/handler/salesdynamics/conversion.php
  • Класс: Bitrix\Crm\Integration\Report\Handler\SalesDynamics\Conversion
  • Вызов: Conversion::getMultipleData
public function getMultipleData()
{
	$calculatedData = $this->getCalculatedData();

	$resultByUser = [];
	$countClosed = $calculatedData['closed'];
	foreach ($countClosed as $dataItem)
	{
		$userId = $dataItem['ASSIGNED_BY_ID'];
		if($dataItem['IS_RETURN_CUSTOMER'] != 'Y')
		{
			$key = ($dataItem['STAGE_SEMANTIC_ID'] == PhaseSemantics::SUCCESS) ? static::COUNT_PRIMARY_WON: static::COUNT_PRIMARY_LOST;
		}
		else
		{
			$key = ($dataItem['STAGE_SEMANTIC_ID'] == PhaseSemantics::SUCCESS) ? static::COUNT_RETURN_WON: static::COUNT_RETURN_LOST;
		}

		$resultByUser[$userId]['value']['USER_ID'] = $userId;
		$resultByUser[$userId]['value'][$key] = $dataItem['CNT'];
	}

	$countInWork = $calculatedData['in_work'];
	foreach ($countInWork as $dataItem)
	{
		$userId = $dataItem['ASSIGNED_BY_ID'];
		$key = ($dataItem['IS_RETURN_CUSTOMER'] != 'Y') ? static::COUNT_PRIMARY_IN_WORK : static::COUNT_RETURN_IN_WORK;

		$resultByUser[$userId]['value']['USER_ID'] = $userId;
		$resultByUser[$userId]['value'][$key] = $dataItem['CNT'];
	}

	return $resultByUser;
}