D
D
Darklt2021-02-21 17:52:22
1C-Bitrix
Darklt, 2021-02-21 17:52:22

How to set random sorting in arrfilter?

I take out

$arSelect = array("ID", "NAME", "PREVIEW_TEXT", "DETAIL_PAGE_URL",'PREVIEW_PICTURE', "PROPERTY_*");
                        $arFilter = array("IBLOCK_ID" => 10, "ACTIVE" => "Y", 'ID' => $SEORES['SEO']['VALUE']);
                        $res = CIBlockElement::GetList(array(), $arFilter, false, array("nPageSize" => 50), $arSelect);


How to set random sort?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Andrey Slashchinin, 2021-02-22
@slashinin

arrfilter is only used to filter data i.e. weeding out excess.
You need to sort through arOrder (first argument)

$res = CIBlockElement::GetList(array("rand" => "asc"), $arFilter, false, array("nPageSize" => 50), $arSelect);

https://dev.1c-bitrix.ru/api_help/iblock/classes/c...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question