ResponsibleFilter::prepareConditions

  1. Bitrix24 API (v. 23.675.0)
  2. crm
  3. ResponsibleFilter
  4. prepareConditions
  • Модуль: crm
  • Путь к файлу: ~/bitrix/modules/crm/lib/counter/counterquerybuilder/queryparts/responsiblefilter.php
  • Класс: Bitrix\Crm\Counter\CounterQueryBuilder\QueryParts\ResponsibleFilter
  • Вызов: ResponsibleFilter::prepareConditions
private function prepareConditions(UserParams $userParams, string $responsibleFieldName): ConditionTree
{
	$ct = new ConditionTree();

	if ($userParams->isExcluded())
	{
		if (count($userParams->userIds()) > 1)
		{
			$ct->whereNotIn($responsibleFieldName, array_merge($userParams->userIds(), [0]));
		}
		else
		{
			$ct->whereNot($responsibleFieldName, $userParams->userIds()[0]);
			$ct->whereNot($responsibleFieldName, 0);
		}
	}
	else
	{
		if (count($userParams->userIds()) > 1)
		{
			$ct->whereIn($responsibleFieldName, $userParams->userIds());
		}
		else
		{
			$ct->where($responsibleFieldName, $userParams->userIds()[0]);
		}
	}

	return $ct;
}

Добавить комментарий