Commit 6dbabf81 authored by clone's avatar clone

1

parent 39216977
......@@ -149,14 +149,14 @@ class SquareSortService
$result = $cream_list;
} elseif ($index_min <= $cream_num && $index_max > $cream_num) {
$residue = $index_max - $cream_num;
$index_end = $num;
$index_end = $num - 1;
$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);
$list = $this->redis->zRange(self::SORT_KEY . $site_id, $index_start, $index_end, true);
$result = $cream_list + $list;
} elseif ($index_min > $cream_num) {
$index_end = $total - ($index_min - $cream_num);
$index_end = $num - 1 - ($index_min - $cream_num);
$index_start = $index_end - $page_size;
$index_start = $index_start > 0 ? $index_start : 0;
$list = $this->redis->zRange(self::SORT_KEY . $site_id, $index_start, $index_end, true);
......
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