mirror of
https://github.com/openvk/openvk
synced 2024-11-11 01:19:53 +03:00
VKAPI: Change behaviour of start_from and next_from params. Timestamp can cause issues, so i just changed it to 'internal' id
This commit is contained in:
parent
343acabff2
commit
863fb232e0
1 changed files with 2 additions and 2 deletions
|
@ -26,7 +26,7 @@ final class Newsfeed extends VKAPIRequestHandler
|
||||||
->select("id")
|
->select("id")
|
||||||
->where("wall IN (?)", $ids)
|
->where("wall IN (?)", $ids)
|
||||||
->where("deleted", 0)
|
->where("deleted", 0)
|
||||||
->where("created < (?)", empty($start_from) ? time()+1 : $start_from)
|
->where("id < (?)", empty($start_from) ? time()+1 : $start_from)
|
||||||
->order("created DESC");
|
->order("created DESC");
|
||||||
|
|
||||||
$rposts = [];
|
$rposts = [];
|
||||||
|
@ -34,7 +34,7 @@ final class Newsfeed extends VKAPIRequestHandler
|
||||||
$rposts[] = (new PostsRepo)->get($post->id)->getPrettyId();
|
$rposts[] = (new PostsRepo)->get($post->id)->getPrettyId();
|
||||||
|
|
||||||
$response = (new Wall)->getById(implode(',', $rposts), $extended, $fields, $this->getUser());
|
$response = (new Wall)->getById(implode(',', $rposts), $extended, $fields, $this->getUser());
|
||||||
$response->next_from = end($response->items)->date;
|
$response->next_from = end($response->items)->id;
|
||||||
return $response;
|
return $response;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue