Merge branch 'release'
This commit is contained in:
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
|
||||
namespace app\common\service;
|
||||
|
||||
use app\common\logic\SysConfigLogic;
|
||||
use app\common\logic\SysCurrencyLogic;
|
||||
use app\common\logic\SystemsLogic;
|
||||
use support\Redis;
|
||||
|
||||
class SysConfigService
|
||||
{
|
||||
|
||||
protected $logic;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->logic = (new SysConfigLogic());
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取系统list
|
||||
*/
|
||||
public static function getConfig(string $config_key)
|
||||
{
|
||||
$value = Redis::get($config_key);
|
||||
if (empty($value)) {
|
||||
$config = (new SysConfigLogic())->findByKey($config_key);
|
||||
if (empty($config)) {
|
||||
return null;
|
||||
}
|
||||
$value = $config->config_value;
|
||||
Redis::set($config->config_key, $value, 'EX', 7200);
|
||||
}
|
||||
|
||||
return $value;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user