Skip to content

Instantly share code, notes, and snippets.

@glooer
Created November 22, 2017 21:43
Show Gist options
  • Save glooer/4274a4e107e7eff595687cf9fcc4ccff to your computer and use it in GitHub Desktop.
Save glooer/4274a4e107e7eff595687cf9fcc4ccff to your computer and use it in GitHub Desktop.
bitrix d7 orm выбор только активных элементов (с учетом даты)
<php
\Bitrix\Iblock\ElementTable::GetList([
'filter' => [
'ACTIVE' => 'Y',
[
"LOGIC" => "OR",
'<ACTIVE_FROM' => new \Bitrix\Main\DB\SqlExpression("NOW()"),
'ACTIVE_FROM' => null,
],
[
"LOGIC" => "OR",
'>ACTIVE_TO' => new \Bitrix\Main\DB\SqlExpression("NOW()"),
'ACTIVE_TO' => null,
],
]
])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment