R
R
Ravenenok2016-02-29 14:40:56
1C-Bitrix
Ravenenok, 2016-02-29 14:40:56

How to use two conditions per 1 property in a filter?

To display the elements of the component, I use an array with complex filtering parameters, but for some reason it does not work. Those. displays lines both with the missing APPROVAL_CODE property and when the property = 000000. I want to ensure that elements are not displayed both with the absence of the property and with equal to = 000000
Below is the filter code, I compare it with the documentation and I can’t find where I made a mistake .

$arFilter = array(
    'IBLOCK_ID' => $arParams['IBLOCK_ID'],
    '!=PROPERTY_NUMBER_DOGOVOR' => false,
    '!=PROPERTY_DATE_RESPONSE' => false,
    array(
        "LOGIC" => "OR",
        array('!PROPERTY_APPROVAL_CODE' => false),
        array('!PROPERTY_APPROVAL_CODE' => '000000')
    ),
    'CREATED_USER_ID' => $USER->GetID(),
    'ACTIVE' => 'Y',
);

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
Ravenenok, 2016-02-29
@Ravenenok

I found the answer myself, an error in logic, tk. in this case, OR is not suitable, because 000000 is !false. The reverse situation is also true, so you need to use AND

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question