Commit e78e9554 authored by zw's avatar zw

1

parent a44b7af4
......@@ -63,6 +63,9 @@ class Square extends Basic
}
}
/**
* @return \think\Response
*/
public function getSquareSortList()
{
$params = $this->params;
......@@ -136,13 +139,13 @@ class Square extends Basic
{
$params = $this->params;
/* $params = array(
/*$params = array(
"level" => 1,//不传是主评论 1是主评论第一级回复 2是第一级回复的回复
"comment_id" => 1, //主评论ID
"agent_id_b" => 1, //被回复人的id
"square_id" => 1, // 开盘id
"square_id" => 5, // 开盘id
"comment" => "123123", // 开盘id
"author_id" => 1, // 主要做推送
"square_site_id" => 10001,
);*/
$square_id = $params['square_id'];
$comment = $params['comment'];
......
......@@ -137,7 +137,7 @@ class SquareSortService
if ($total <= $page_size) {
$cream_list = $this->redis->zRange(self::SORT_KEY_CREAM . $site_id, 0, -1, true);
$list = $this->redis->zRange(self::SORT_KEY . $site_id, 0, -1, true);
$result = array_merge($cream_list, $list);
$result = $cream_list + $list;
} elseif ($index_min <= $cream_num && $index_max <= $cream_num) {
$cream_list = $this->redis->zRange(self::SORT_KEY_CREAM . $site_id, $index_min, $page_size, true);
$result = $cream_list;
......@@ -145,7 +145,7 @@ class SquareSortService
$residue = $index_max - $cream_num;
$cream_list = $this->redis->zRange(self::SORT_KEY_CREAM . $site_id, $index_min, -1, true);
$list = $this->redis->zRange(self::SORT_KEY . $site_id, 0, $residue, true);
$result = array_merge($cream_list, $list);
$result = $cream_list + $list;
} elseif ($index_min > $cream_num) {
$index_ = $index_min - $cream_num;
$list = $this->redis->zRange(self::SORT_KEY . $site_id, $index_, $page_size, 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