J
J
jakiro10072021-06-07 14:40:00
1C-Bitrix
jakiro1007, 2021-06-07 14:40:00

How to filter for getlist between two properties?

There is a getList

//получение элементов
$rs_Elements = CIBlockElement::GetList(array(), array('IBLOCK_ID' => $infoblock_res, "SECTION_ID" => $ar_Resu["RESULT_SEC"][0]["ID"],
    "PROPERTY_MAX_PROCENT" => $l, "PROPERTY_MIN_PROCENT" => $l
    ));
while ($ob = $rs_Elements->GetNextElement() ) {
    //Поля
    $ar_Elements["RESULT_SEC"][] = $ob->GetFields();
    $ar_Props["PROPS"][] = $ob->GetProperties();
}


It has two properties - PROPERTY_MIN_PROCENT AND PROPERTY_MAX_MIN
There is also a variable $l which contains a random number
How to make a filter for getlist so that getlist pulls out elements with $l between two properties?
For example, in element A:
PROPERTY_MIN_PROCENT = 5
PROPERTY_MAX_MIN = 30
$l = 10
If the variable l falls within the range of these properties, then this element is displayed in getlist
how to implement this?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
T
tgarl, 2021-06-07
@jakiro1007

"<=PROPERTY_MAX_PROCENT" => $l, 
">=PROPERTY_MIN_PROCENT" => $l

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question