• Модуль: imopenlines
  • Путь к файлу: ~/bitrix/modules/imopenlines/lib/integrations/report/statistics/dialog.php
  • Класс: BitrixImOpenLinesIntegrationsReportStatisticsDialog
  • Вызов: Dialog::updateRecord
public function updateRecord(array $existingRecord)
{
	$primary = array(
		'DATE' => $this->getDate(),
		'OPEN_LINE_ID' => $this->getOpenLineId(),
		'SOURCE_ID' => $this->getSourceId(),
		'OPERATOR_ID' => $this->getOperatorId(),
	);

	$fields = array();
	if ($this->getStatus() === self::STATUS_ANSWERED)
	{
		$fields['ANSWERED_QTY'] = $existingRecord['ANSWERED_QTY'] + 1;
		$fields['AVERAGE_SECS_TO_ANSWER'] =  floor(($existingRecord['AVERAGE_SECS_TO_ANSWER'] + $this->getSecsToAnswer()) / ($existingRecord['ANSWERED_QTY'] + 1));
	}

	if ($this->getStatus() === self::STATUS_NO_PRECESSED)
	{
		$fields['APPOINTED_QTY'] = $existingRecord['APPOINTED_QTY'] + 1;
	}

	if ($this->getStatus() === self::STATUS_SKIPPED)
	{
		$fields['SKIP_QTY'] = $existingRecord['SKIP_QTY'] + 1;
	}

	DialogStatTable::update($primary, array(
		'fields' => $fields
	));
}