Commit 56101707 authored by clone's avatar clone

1

parent 328396a0
...@@ -149,8 +149,9 @@ class SquareSortService ...@@ -149,8 +149,9 @@ class SquareSortService
$result = $cream_list; $result = $cream_list;
} elseif ($index_min <= $cream_num && $index_max > $cream_num) { } elseif ($index_min <= $cream_num && $index_max > $cream_num) {
$residue = $index_max - $cream_num; $residue = $index_max - $cream_num;
$index_end = $total; $index_end = $num;
$index_start = $total - ($page_size - $residue); $index_start = $num - ($page_size - $cream_num);
$index_start = $index_start > 0 ? $index_start : 0;
$cream_list = $this->redis->zRange(self::SORT_KEY_CREAM . $site_id, 0, $residue, true); $cream_list = $this->redis->zRange(self::SORT_KEY_CREAM . $site_id, 0, $residue, true);
$list = $this->redis->zRange(self::SORT_KEY . $site_id, $index_start, $index_end, true); $list = $this->redis->zRange(self::SORT_KEY . $site_id, $index_start, $index_end, true);
$result = $cream_list + $list; $result = $cream_list + $list;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment