UserDontAuth::filter

  1. Bitrix24 API (v. 23.675.0)
  2. sender
  3. UserDontAuth
  4. filter
  • Модуль: sender
  • Путь к файлу: ~/bitrix/modules/sender/lib/integration/main/triggers/userdontauth.php
  • Класс: Bitrix\Sender\Integration\Main\Triggers\UserDontAuth
  • Вызов: UserDontAuth::filter
public function filter()
{
	$daysDontAuth = $this->getFieldValue('DAYS_DONT_AUTH');
	if(!is_numeric($daysDontAuth))
		$daysDontAuth = 90;

	$dateFrom = new DateTime;
	$dateTo = new DateTime;

	$dateFrom->setTime(0, 0, 0)->add('-' . $daysDontAuth . ' days');
	$dateTo->setTime(0, 0, 0)->add('1 days')->add('-' . $daysDontAuth . ' days');

	if($this->isRunForOldData())
	{
		$filter = array(
			'!LAST_LOGIN' => null,
			' $dateTo,
		);
	}
	else
	{
		$filter = array(
			'>LAST_LOGIN' => $dateFrom,
			' $dateTo,
		);
	}

	$filter['=ACTIVE'] = true;
	$userListDb = UserTable::getList(array(
		'select' => array('EMAIL', 'ID', 'NAME'),
		'filter' => $filter,
		'order' => array('ID' => 'ASC')
	));
	if($userListDb->getSelectedRowsCount() > 0)
	{
		$userListDb->addFetchDataModifier(array($this, 'getFetchDataModifier'));
		$this->recipient = $userListDb;
		return true;
	}
	else
		return false;
}

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