Answer the question
In order to leave comments, you need to log in
How to set an OR condition in a filter?
It is necessary to select elements with filled PROPERTY_TIME outside the period $from, $to and with empty PROPERTY_TIME. I did this, but it returns an empty selection, although there are such elements. So I understand that he joins the conditions through AND, but how to set OR?
$arFilter = Array(
"IBLOCK_ID" => $iblock_id,
"SECTION_ID" => $section_id,
"INCLUDE_SUBSECTIONS" => "Y",
"<PROPERTY_TIME" => array(false, date('Y-m-d H:i:s', $from)),
">PROPERTY_TIME" => array(false, date('Y-m-d H:i:s', $to)),
);
$elList = new CIBlockElement();
$rs = $elList->GetList(
Array("RAND" => "ASC"),
$arFilter,
false,
Array("nTopCount" => 5),
Array("ID", "NAME")
);
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question