- Модуль: sender
- Путь к файлу: ~/bitrix/modules/sender/lib/stat/statistics.php
- Класс: BitrixSenderStatStatistics
- Вызов: Statistics::getCounters
public function getCounters()
{
if ($this->counters !== null)
{
return $this->counters;
}
$list = array();
$filter = $this->getMappedFilter();
$select = array(
'SEND_ALL' => 'COUNT_SEND_ALL',
'SEND_ERROR' => 'COUNT_SEND_ERROR',
'SEND_SUCCESS' => 'COUNT_SEND_SUCCESS',
'READ' => 'COUNT_READ',
'CLICK' => 'COUNT_CLICK',
'UNSUB' => 'COUNT_UNSUB'
);
$runtime = array();
foreach ($select as $alias => $fieldName)
{
$runtime[] = new ExpressionField($alias, 'SUM(%s)', $fieldName);
}
$listDb = PostingTable::getList(array(
'select' => array_keys($select),
'filter' => $filter,
'runtime' => $runtime,
'cache' => array('ttl' => $this->getCacheTtl(), 'cache_joins' => true)
));
while ($item = $listDb->fetch())
{
$list = array_merge($list, $this->createListFromItem($item));
}
$this->counters = $list;
return $list;
}