mirror of
https://github.com/flarum/framework.git
synced 2025-01-19 18:12:59 +08:00
Fix subsequent pages of results not working properly
This commit is contained in:
parent
0ce00c6d16
commit
c7d7b2d360
|
@ -69,7 +69,7 @@ class PinStickiedDiscussionsToTop
|
|||
if (empty($gambits)) {
|
||||
$sticky = clone $query;
|
||||
$sticky->where('is_sticky', true);
|
||||
$sticky->limit = $sticky->offset = $sticky->orders = null;
|
||||
$sticky->orders = null;
|
||||
|
||||
$query->union($sticky);
|
||||
|
||||
|
@ -89,6 +89,9 @@ class PinStickiedDiscussionsToTop
|
|||
$query->unionOrders = array_merge($query->unionOrders, $query->orders);
|
||||
$query->unionLimit = $query->limit;
|
||||
$query->unionOffset = $query->offset;
|
||||
|
||||
$query->limit = $sticky->limit = $query->offset + $query->limit;
|
||||
$query->offset = $sticky->offset = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user