DealWork::prepareActivityQuery

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

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

	return $query;
}

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