VKAPI: Fix error 500 on Users.search method

This commit is contained in:
veselcraft 2022-03-27 15:08:27 +03:00
parent f505887d7f
commit c3ebcabda3
No known key found for this signature in database
GPG key ID: AED66BC1AC628A4E

View file

@ -158,13 +158,14 @@ final class Users extends VKAPIRequestHandler
$users = new UsersRepo;
$array = [];
$find = $users->find($q);
foreach ($users->find($q) as $user) {
foreach ($find as $user) {
$array[] = $user->getId();
}
return (object)[
"count" => $users->getFoundCount($q),
"count" => $find->size(),
"items" => $this->get(implode(',', $array), $fields, $offset, $count)
];
}