Подскажите пожалуйста, как вывести блоки отзывов по дате активности?
Постановка задачи конечно не очень красивая, но по другому не знаю как это сделать.
На данной странице блоки выводятся по дате создания:
<? if (!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED !== true) die();
$this->setFrameMode(true);
use \Bitrix\Main\Localization\Loc;
use \Bas\Pict;
?><? if (empty($arResult["REVIEWS"])) return; ?>
<div class="reviews-carusel pt-24 pb-48" id="reviews">
<div class="center-wrap">
<div class="reviews-carusel__wrap">
<div class="type-carusel js-swiper__reviews">
<div class="type-carusel__head --reviews flex --align-center --just-space mb-18">
<div class="type-carusel__title"><?=$arResult["META_H1"]?></div>
<div class="type-carusel__nav flex --align-center">
<div class="type-carusel__pagination">
<div class="swiper-pagination"></div>
</div>
<div class="type-carusel__show-all-wrap flex mob-hide ml-24">
<a href="/reviews/" class="type-carusel__show-all btn --fill-4"><span>Показать все</span></a>
</div>
</div>
</div>
<div class="type-carusel__swiper">
<div class="type-carusel__btn mob-hide --left --svg__carusel-arrow-dark--left swiper-button-prev"></div>
<div class="swiper-container">
<div class="swiper-wrapper swiper-wrapper-custom">
<? foreach ($arResult["REVIEWS"] as $key => $arReview): ?>
<?
$pc = CFile::GetPath($arReview["PREVIEW_PICTURE"]);
$pictureID = $arReview["PREVIEW_PICTURE"];
$arReview["PREVIEW_PICTURE"] = array();
$arReview["PREVIEW_PICTURE"]["ID"] = $pictureID;
$arReview["PREVIEW_PICTURE"]["src"] = CFile::GetPath($pictureID);
$pic = CFile::GetPath($arReview["PREVIEW_PICTURE"]);
$arReview['PREVIEW_PICTURE'] = Pict::getWebp($arReview['PREVIEW_PICTURE']);
$bgimage = ($arReview['PREVIEW_PICTURE']["WEBP_SRC"] != '') ? $arReview['PREVIEW_PICTURE']["WEBP_SRC"] : $arReview['PREVIEW_PICTURE']["src"];
?>
<div class="swiper-slide <?=$arReview["PREVIEW_PICTURE"]["SRC"]?>">
<div class="review-card">
<div class="review-card__info flex --just-space --align-center">
<div class="review-card__name p --l col --auto mr-16"><?=$arReview["NAME"]?></div>
<div class="review-card__date p --m"><?=explode(' ', $arReview["DATE_CREATE"])[0]?></div>
</div>
<div class="review-card__rate-info flex --align-center --just-space mt-8 mb-16">
<div class="review-card__rate flex --align-center">
<?for($i = 0; $i < $arReview["PROPERTY_RATING_VALUE"]; $i++):?>
<div class="review-card__rate-star --svg__reviews--star-gold"></div>
<?endfor;?>
<?for($i = 5; $i > $arReview["PROPERTY_RATING_VALUE"]; $i--):?>
<div class="review-card__rate-star --svg__reviews--star-gray"></div>
<?endfor;?>
</div>
<div class="review-card__rate-date p --m">docdoc</div>
</div>
<? if($arResult["SERVICES"][$arReview["PROPERTY_SERVICE_VALUE"]]["NAME"]) { ?>
<div class="review-card__service flex my-8">
<div class="review-card__service-label flex --align-center mr-8 p --m">
<div class="review-card__service-icon --svg__reviews--gear mr-8"></div>
<span>Услуга:</span>
</div>
<a href="<?= $arResult["SERVICES"][$arReview["PROPERTY_SERVICE_VALUE"]]["SECTION_PAGE_URL"]; ?>" class="review-card__service-link col --auto link --color-1 p --m"><b><?= $arResult["SERVICES"][$arReview["PROPERTY_SERVICE_VALUE"]]["NAME"]; ?></b></a>
</div>
<? } ?>
<? if($arReview["PROPERTY_CLINICK_VALUE"]) { ?>
<div class="review-card__service flex my-8">
<div class="review-card__service-label flex --align-center mr-8 p --m">
<div class="review-card__service-icon --svg__reviews--clinick mr-8"></div>
<span>Филиал:</span>
</div>
<div class="review-card__service-link col --auto link --color-1 p --m"><b><?= $arReview["PROPERTY_CLINICK_VALUE"] ?></b></div>
</div>
<? } ?>
<div class="review-card__content flex mt-16">
<? if($pc) { ?>
<a href="<?=$pc?>" data-fancybox="scan" class="review-card__scan mr-16 lazy" data-background-image="<?=$pc?>"></a>
<? } ?>
<div class="review-card__desc col --auto p --m"><?=$arReview["PREVIEW_TEXT"]?> ... <a href="#review-<?=$key?>" class="link --color-1" data-popup="#review-<?=$key?>"><b>еще</b></a></div>
</div>
</div>
</div>
<?endforeach;?>
</div>
</div>
<div class="type-carusel__btn mob-hide --right --svg__carusel-arrow-dark--right swiper-button-next"></div>
</div>
</div>
</div>
</div>
</div>
<? foreach ($arResult["REVIEWS"] as $key => $arReview): ?>
<div class="popup" id="review-<?=$key?>">
<div class="popup__wrap">
<div class="popup__content --base">
<div class="popup__close js-popup__close"></div>
<div class="review-detail">
<div class="review-card">
<div class="review-card__info flex --just-space --align-center">
<div class="review-card__name p --l col --auto mr-16"><?=$arReview["NAME"]?></div>
<div class="review-card__date p --m"><?=explode(' ', $arReview["DATE_CREATE"])[0]?></div>
</div>
<div class="review-card__rate-info flex --align-center --just-space mt-8">
<div class="review-card__rate flex --align-center">
<?for($i = 0; $i < $arReview["PROPERTY_RATING_VALUE"]; $i++):?>
<div class="review-card__rate-star --svg__reviews--star-gold"></div>
<?endfor;?>
<?for($i = 5; $i > $arReview["PROPERTY_RATING_VALUE"]; $i--):?>
<div class="review-card__rate-star --svg__reviews--star-gray"></div>
<?endfor;?>
</div>
<div class="review-card__rate-date p --m">docdoc</div>
</div>
<div class="review-card__service flex my-16">
<div class="review-card__service-label flex --align-center mr-8 p --m">
<div class="review-card__service-icon --svg__reviews--gear mr-8"></div>
<span>Услуга:</span>
</div>
<a href="<?= $arResult["SERVICES"][$arReview["PROPERTY_SERVICE_VALUE"]]["SECTION_PAGE_URL"]; ?>" class="review-card__service-link col --auto link --color-1 p --m"><b><?= $arResult["SERVICES"][$arReview["PROPERTY_SERVICE_VALUE"]]["NAME"]; ?></b></a>
</div>
<div class="review-card__content">
<div class="review-card__desc col --auto p --m"><?=$arReview["DETAIL_TEXT"]?></div>
</div>
</div>
</div>
<div class="flex mt-32">
<div class="btn --fill-1 --m js-popup__close">Закрыть</div>
</div>
</div>
<div class="popup__shade js-popup__close"></div>
</div>
</div>
<?endforeach;?>