• Модуль: crm
  • Путь к файлу: ~/bitrix/modules/crm/lib/integration/report/handler/customers/regularcustomers.php
  • Класс: Bitrix\Crm\Integration\Report\Handler\Customers\RegularCustomers
  • Вызов: RegularCustomers::findGroup
static function findGroup(int $dealCount)
{
	foreach (static::GROUPS as [$min, $max])
	{
		if($min == $max && $min == $dealCount)
		{
			return [$min, $max];
		}
		if($max > $min && $dealCount <= $max && $dealCount >= $min )
		{
			return [$min, $max];
		}
		if($max == 0 && $dealCount >= $min)
		{
			return [$min, $max];
		}
	}
	throw new SystemException("Could not find suitable group for {$dealCount} deals");
}