CallTrackerActivityCounter::calculateValue

  1. Bitrix24 API (v. 23.675.0)
  2. crm
  3. CallTrackerActivityCounter
  4. calculateValue
  • Модуль: crm
  • Путь к файлу: ~/bitrix/modules/crm/lib/counter/calltrackeractivitycounter.php
  • Класс: Bitrix\Crm\Counter\CallTrackerActivityCounter
  • Вызов: CallTrackerActivityCounter::calculateValue
public function calculateValue(): int
{
	if (!\Bitrix\Crm\Settings\CounterSettings::getInstance()->isEnabled())
	{
		return 0; // counters feature is completely disabled
	}

	$query = $this->prepareEntityQuery(\CCrmOwnerType::Deal);
	$query->setSelect([
		'QTY' => new ExpressionField('QTY', 'COUNT(*)')
	]);

	$fields = $query->fetch();
	return is_array($fields) ? (int)$fields['QTY'] : 0;
}

Добавить комментарий