feat : order

This commit is contained in:
2025-03-04 15:41:51 +08:00
parent 319f0c03d4
commit 11b4496fa7
7 changed files with 69 additions and 29 deletions

View File

@@ -64,7 +64,7 @@ class ConfigCache
* @param $key
* @param int $isRedis
* @param int $expire
* @return false|HigherOrderTapProxy|mixed|\Redis|string|null
* @return false|HigherOrderTapProxy|mixed|\Redis|string
* @throws ContainerExceptionInterface
* @throws NotFoundExceptionInterface
*/
@@ -77,10 +77,10 @@ class ConfigCache
if ($isRedis == 1) {
$this->redis->setEx($redisKey, $value, $expire,RedisCode::SYSTEM_DB);
}
return $value;
return $value ?? ConfigCode::DEFAULT_VALUE[$key];
}
return $this->redis->get($key,RedisCode::SYSTEM_DB) ?? ConfigCode::DEFAULT_VALUE[$key];
return $this->redis->get($redisKey,RedisCode::SYSTEM_DB) ?? ConfigCode::DEFAULT_VALUE[$key];
}
/**

View File

@@ -542,6 +542,20 @@ class RedisCache
return $this->getRedis($poolName)->zRem($key, $value);
}
/**
* @param $key
* @param $score
* @param $value
* @param string $poolName
* @return Redis|float|false
* @throws ContainerExceptionInterface
* @throws NotFoundExceptionInterface
*/
public function zIncrBy($key,$score, $value, string $poolName = RedisCode::DEFAULT_DB): Redis|float|false
{
return $this->getRedis($poolName)->zIncrBy($key, $score, $value);
}
/**
* @param $key
* @param $value