feat : rank
This commit is contained in:
@@ -73,4 +73,15 @@ class ApiRedisKey
|
||||
{
|
||||
return 'lock:refund:user_id:'. $userId;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $cityId
|
||||
* @param int $type
|
||||
* @param int $timeKey
|
||||
* @return string
|
||||
*/
|
||||
public static function getLeaderboardByCityIdAndType(int $cityId, int $type, int $timeKey): string
|
||||
{
|
||||
return 'chef:leaderboard:city_id:'.$cityId.':type:'.$type.':time_key:'.$timeKey;
|
||||
}
|
||||
}
|
||||
@@ -560,6 +560,21 @@ class RedisCache
|
||||
{
|
||||
return $this->getRedis($poolName)->zRank($key, $value);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param $key
|
||||
* @param int $start
|
||||
* @param int $end
|
||||
* @param bool $score
|
||||
* @param string $poolName
|
||||
* @return array|false|Redis
|
||||
* @throws ContainerExceptionInterface
|
||||
* @throws NotFoundExceptionInterface
|
||||
*/
|
||||
public function zRevRange($key, int $start = 0, int $end = -1, $score = false, string $poolName = RedisCode::DEFAULT_DB): false|array|Redis
|
||||
{
|
||||
return $this->getRedis($poolName)->zRevRange($key, $start, $end,$score);
|
||||
}
|
||||
// +--------------------------------------------------------------------------------------------------------------------------------------------
|
||||
// | geo
|
||||
// +--------------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user