D
D
dimquea2022-03-05 11:08:12
1C-Bitrix
dimquea, 2022-03-05 11:08:12

How to set limits on the highloadblock multilevel filter?

There is an HL block, one of the timestamp fields, the second multiple id of related elements from another table.
You need to get records:
- 1 record for each id of the associated element, the timestamp of which is the largest, but less than the current
one - all records for each id of the associated element, the timestamp of which is greater than the current
The filter itself is simple, but I can’t figure out how to set the limits:

$rsData = $entity_data_class::getList(array(
    "order" => array("UF_TIMESTAMP" => "DESC"),
    "filter" => array(
        'LOGIC' => 'OR',
        array(
            "UF_IDS" => $IDs,
            "<=UF_TIMESTAMP" => $currentTS
        ),
        array(
            "UF_IDS" => $IDs,
            ">=UF_TIMESTAMP" => $currentTS
        )
    )
));

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question