FillLightCounterPart2::execute

  1. Bitrix24 API (v. 23.675.0)
  2. crm
  3. FillLightCounterPart2
  4. execute
  • Модуль: crm
  • Путь к файлу: ~/bitrix/modules/crm/lib/agent/activity/lightcounter/filllightcounterpart2.php
  • Класс: Bitrix\Crm\Agent\Activity\LightCounter\FillLightCounterPart2
  • Вызов: FillLightCounterPart2::execute
public function execute(): bool
{
	if (Option::get('crm', self::PART_IS_DONE_NAME, 'N') === 'Y')
	{
		return self::PART_IS_DONE;
	}

	$lastId = $this->getLastId();
	$rows = $this->queryItemsToProcess($lastId);

	if (empty($rows))
	{
		Option::set('crm', self::PART_IS_DONE_NAME, 'Y');
		return self::PART_IS_DONE;
	}

	$dataToProcess = $this->uniqueRows($rows);

	foreach ($dataToProcess as $item)
	{
		$minLightTime = $this->findMinLightTime($item['ENTITY_TYPE_ID'], $item['ENTITY_ID']);
		$this->updateUncompletedActTable($item['ENTITY_TYPE_ID'], $item['ENTITY_ID'], $minLightTime);
	}

	$this->setLastId(end($rows)['ID']);

	return self::PART_HAS_MORE_ITERATIONS;
}

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