• Модуль: sender
  • Путь к файлу: ~/bitrix/modules/sender/lib/posting.php
  • Класс: BitrixSenderPostingTable
  • Вызов: PostingTable::getRecipientCountByStatus
static function getRecipientCountByStatus($id, ?array $customFilter = null)
{
	$statusList = [];
	$select = ['CNT', 'STATUS'];
	$filter = !$customFilter?['POSTING_ID' => $id] : ['LOGIC' => 'AND',['POSTING_ID' => $id],$customFilter];
	$postingContactDb = PostingRecipientTable::getList([
		'select' => $select,
		'filter' => $filter,
		'runtime' => [new EntityExpressionField('CNT', 'COUNT(*)')],
	]);
	while($postingContact = $postingContactDb->fetch())
		$statusList[$postingContact['STATUS']] = intval($postingContact['CNT']);

	return $statusList;
}