• Модуль: crm
  • Путь к файлу: ~/bitrix/modules/crm/lib/integration/report/handler/salesdynamics/wonlostprevious.php
  • Класс: Bitrix\Crm\Integration\Report\Handler\SalesDynamics\WonLostPrevious
  • Вызов: WonLostPrevious::addTimePeriodToQuery
public function addTimePeriodToQuery(Query $query, $timePeriodValue)
{
	if ($timePeriodValue['from'] !== "" && $timePeriodValue['to'] !== "")
	{
		$from = new DateTime($timePeriodValue["from"]);
		$to = new DateTime($timePeriodValue["to"]);

		list($newFrom, $newTo) = static::getPreviousPeriod($from, $to);

		$query->whereBetween("CLOSEDATE", $newFrom, $newTo);
	}
}