Commit 328396a0 authored by zw's avatar zw

1

parent 9504ab69
...@@ -43,7 +43,7 @@ class SquareSortService ...@@ -43,7 +43,7 @@ class SquareSortService
$look_num = $this->redis->zScore(self::LOOK_NUM_KEY, $s_id); $look_num = $this->redis->zScore(self::LOOK_NUM_KEY, $s_id);
$this->redis->zRem(self::SORT_KEY . $site_id, $s_id); $this->redis->zRem(self::SORT_KEY . $site_id, $s_id);
$this->redis->zRem(self::SORT_KEY_CREAM . $site_id, $s_id); $this->redis->zRem(self::SORT_KEY_CREAM . $site_id, $s_id);
if ($look_num > 3) { if ($look_num >= 3) {
$m_square = new BSquare(); $m_square = new BSquare();
$m_square->updateStatus(['id'=>$s_id], ['is_cream'=>1]); $m_square->updateStatus(['id'=>$s_id], ['is_cream'=>1]);
$this->redis->zAdd(self::SORT_KEY_CREAM . $site_id, time(), $s_id); $this->redis->zAdd(self::SORT_KEY_CREAM . $site_id, time(), $s_id);
......
...@@ -40,7 +40,7 @@ class BSquare extends Model ...@@ -40,7 +40,7 @@ class BSquare extends Model
$result = Db::table($this->table) $result = Db::table($this->table)
->field($field) ->field($field)
->where($params) ->where($params)
->order("FIELD(id,$ids)") ->order("is_cream asc,FIELD(id,$ids)")
->select(); ->select();
return $result; return $result;
} }
......
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