16 $userIds = array_map(fn ($a) => (
int)$a, $userIds);
26 $cursor = UserTable::getList([
27 'select' => [
'ID',
'LAST_ACTIVITY_DATE'],
28 'filter' => [
'=ID' => $userIds],
31 foreach ($cursor->getIterator() as $row)
33 if ($row[
'LAST_ACTIVITY_DATE'] instanceof
DateTime)
36 $lastSeen = $row[
'LAST_ACTIVITY_DATE']->getTimestamp();
37 $timestamps[$userId] = $lastSeen;
38 $result[$userId] = $now - $lastSeen;
42 if ($sendToQueueSever && !empty($timestamps))
45 function (array $timestamps) {