Compatible::joinUncompletedActivityTable

  1. Bitrix24 API (v. 23.675.0)
  2. crm
  3. Compatible
  4. joinUncompletedActivityTable
  • Модуль: crm
  • Путь к файлу: ~/bitrix/modules/crm/lib/counter/counterquerybuilder/idle/uncompletedbased.php
  • Класс: Bitrix\Crm\Counter\CounterQueryBuilder\Idle\UncompletedBased
  • Вызов: UncompletedBased::joinUncompletedActivityTable
private function joinUncompletedActivityTable(QueryParams $params, Query $query): void
{
	$referenceFilter = (new ConditionTree())
		->whereColumn('ref.ENTITY_ID', 'this.ID')
		->where('ref.ENTITY_TYPE_ID', new SqlExpression($params->entityTypeId()));

	if ($params->useActivityResponsible())
	{
		$this->responsibleFilter->apply($referenceFilter, $params->userParams(), 'ref.RESPONSIBLE_ID');
	}
	else
	{
		$referenceFilter->where('ref.RESPONSIBLE_ID', new SqlExpression('?i', 0)); // 0 means "All users"
	}

	$query->registerRuntimeField(
		'',
		new ReferenceField('B',
			EntityUncompletedActivityTable::getEntity(),
			$referenceFilter,
			['join_type' => Join::TYPE_LEFT]
		)
	);
}

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