• Модуль: crm
  • Путь к файлу: ~/bitrix/modules/crm/lib/binding/dealcontact.php
  • Класс: Bitrix\Crm\Binding\DealContactTable
  • Вызов: DealContactTable::getDealsContactIds
static function getDealsContactIds(array $dealIds): array
{
	$dealIds = array_map('intval', $dealIds);
	$dealIds = array_filter($dealIds, static function ($id) {
		return $id > 0;
	});

	$result = [];

	if(count($dealIds) <= 0)
	{
		return $result;
	}
	$collection = static::getList([
		'select' => ['CONTACT_ID'],
		'filter' => [
			'@DEAL_ID' => $dealIds,
		],
	])->fetchCollection();
	foreach ($collection as $item)
	{
		$result[$item->getDealId()][] = $item->getContactId();
	}

	return $result;
}