DealWork::prepareHistoryQuery

  1. Bitrix24 API (v. 23.675.0)
  2. crm
  3. DealWork
  4. prepareHistoryQuery
  • Модуль: crm
  • Путь к файлу: ~/bitrix/modules/crm/lib/widget/data/dealwork.php
  • Класс: Bitrix\Crm\Widget\Data\DealWork
  • Вызов: DealWork::prepareHistoryQuery
static function prepareHistoryQuery($startDate, $endDate, $groupByDate = true)
{
	$query = new Query(DealStageHistoryTable::getEntity());
	$query->addSelect('OWNER_ID');
	$query->addFilter('=IS_LOST', false);
	$query->addFilter('>=CREATED_DATE', $startDate);
	$query->addFilter('<=CREATED_DATE', $endDate);
	$query->addGroup('OWNER_ID');

	if($groupByDate)
	{
		$query->addSelect('CREATED_DATE', 'DATE');
		$query->addGroup('CREATED_DATE');
		$query->addOrder('CREATED_DATE', 'ASC');
	}

	return $query;
}

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