• Модуль: imopenlines
  • Путь к файлу: ~/bitrix/modules/imopenlines/lib/integrations/report/handlers/treatment.php
  • Класс: BitrixImOpenLinesIntegrationsReportHandlersTreatment
  • Вызов: Treatment::prepareResultByWhatWillCalculate
protected function prepareResultByWhatWillCalculate($data, $whatWillCalculateValue)
{
	$result = array();
	foreach ($data as $groupingKey => $value)
	{
		switch ($whatWillCalculateValue)
		{
			case self::WHAT_WILL_CALCULATE_CONTENTMENT:
				$result[$groupingKey]['value'] = floor(array_sum($value['value']) / count($value['value']));
				$result[$groupingKey]['label'] = $value['label'];
				break;
			default:
				$result[$groupingKey]['value'] = array_sum($value['value']);
				$result[$groupingKey]['label'] = $value['label'];


		}
	}

	return $result;
}