31 lines
592 B
PHP
31 lines
592 B
PHP
<?php
|
|
|
|
namespace App\Cache\Redis\Common;
|
|
|
|
use App\Cache\Redis\RedisCache;
|
|
use App\Model\Config;
|
|
use App\Model\Cycle;
|
|
use Hyperf\Di\Annotation\Inject;
|
|
|
|
class ConfigCache
|
|
{
|
|
/**
|
|
* @var RedisCache
|
|
*/
|
|
#[Inject]
|
|
protected RedisCache $redis;
|
|
|
|
/**
|
|
* @var Config $configModel
|
|
*/
|
|
#[Inject]
|
|
protected Config $configModel;
|
|
|
|
public function setConfigCacheByPid($pid)
|
|
{
|
|
$key = CommonRedisKey::getSystemConfigList($pid);
|
|
if ($this->redis->exists($key,'system')) return json_decode($this->redis->get($key),true);
|
|
|
|
return [];
|
|
}
|
|
} |