M
M
Maxim E2016-10-25 19:13:41
PHP
Maxim E, 2016-10-25 19:13:41

How to filter by multiple property in Bitrix?

There is an infoblock, it has a multiple property of the "Date/Time" type.
How can I get records in which one of the values ​​will be within the limits specified in the filter?
There are 2 entries.
One:
05.10.2016 08:01:00
03.10.2016 16:01:00
For the second:
30.11.2016 16:01:00
29.11.2016
16:01:00 time or with it)?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
N
Nikita, 2016-10-25
@creativeworm

The task for using the complex logic of filter formation in Bitrix

array( 
"LOGIC" => "AND", 
">data" => "value", 
"<data" => "value" 
)

D
Danbka, 2016-10-26
@Danbka

Adding an array with AND logic to the filter does not make sense, because AND logic is applied by default. So it can be abbreviated like this:

$arFilter = array( 
    "IBLOCK_ID" => $arResult["ID"], 
    "IBLOCK_LID" => SITE_ID, 
    "ACTIVE" => "Y", 
    ">PROPERTY_DATE" => "value",
    "<PROPERTY_DATE" => "value",
)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question