We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Is your feature request related to a problem? Please describe. forPageAfterId 只适用于正序列序列表分页
Describe the solution you'd like 希望提供 forPageBeforeId 支持倒序列表分页 自增ID越大的越新排在越前边
The text was updated successfully, but these errors were encountered:
这个加个 order 不就行了么?
有没有例子。。
Sorry, something went wrong.
除了order还有一个比较ID大小的查询条件
public function forPageBeforeId($perPage = 15, $lastId = 0, $column = 'id') { $this->orders = $this->removeExistingOrdersFor($column); if (! is_null($lastId)) { $this->where($column, '<', $lastId); } return $this->orderBy($column, 'desc') ->limit($perPage); } public function forPageAfterId($perPage = 15, $lastId = 0, $column = 'id') { $this->orders = $this->removeExistingOrdersFor($column); if (! is_null($lastId)) { $this->where($column, '>', $lastId); } return $this->orderBy($column, 'asc') ->limit($perPage); }
可以的,我抽空加一下
limingxinleo
Successfully merging a pull request may close this issue.
Is your feature request related to a problem? Please describe.
forPageAfterId 只适用于正序列序列表分页
Describe the solution you'd like
希望提供 forPageBeforeId 支持倒序列表分页
自增ID越大的越新排在越前边
The text was updated successfully, but these errors were encountered: