Answer the question
In order to leave comments, you need to log in
Answer the question
In order to leave comments, you need to log in
\Bitrix\Main\Loader::includeModule('sale');
$date = new \Bitrix\Main\Type\Date();
$date->add('-2 year');
$userDataByOrders = \Bitrix\Sale\Order::getList([
'filter' => ['>DATE_INSERT' => $date->toString()],
'select' => ['USER_ID', 'USER_INFO_' => 'USER'],
'group' => ['USER_ID']
]);
$userData = $userDataByOrders->fetchAll();
Get a list of orders for the last 2 years. Get an array of user ids from it. Make CUser::GetList filter by id
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question