• Модуль: sender
  • Путь к файлу: ~/bitrix/modules/sender/lib/stat/statistics.php
  • Класс: BitrixSenderStatStatistics
  • Вызов: Statistics::getCounterSubscribers
public function getCounterSubscribers()
{
	$filter = array('=IS_UNSUB' => 'N');
	$map = array(
		'mailingId' => '=MAILING_ID',
		'periodFrom' => '>DATE_INSERT',
		'periodTo' => 'filter->getMappedArray($map, $filter);

	$query = MailingSubscriptionTable::query();
	$query->addSelect(new ExpressionField('CNT', 'COUNT(1)'));
	$query->setFilter($filter);
	$query->setCacheTtl($this->getCacheTtl());
	$query->cacheJoins(true);
	$result = $query->exec()->fetch();

	return self::getCounterCalculation('SUBS', $result['CNT']);
}