系统设置

This commit is contained in:
2025-10-28 16:59:51 +08:00
parent 1bd2eee8db
commit 2127473290
7 changed files with 278 additions and 0 deletions
+37
View File
@@ -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;
}
}