初始化

This commit is contained in:
liut
2021-10-12 11:06:24 +08:00
commit ff0b4d5b12
1270 changed files with 405680 additions and 0 deletions
@@ -0,0 +1,28 @@
<?php
namespace app\common\behavior;
use app\common\model\Setting;
use think\facade\Cache;
use think\facade\Config;
class LoadConfigRun
{
public function run(){
$conf_cache = Cache::get('_setting_config');
if(empty($conf_cache)){
$conf_cache = Setting::select()->toArray();
Cache::set('_setting_config',$conf_cache);
}
// 加载配置
foreach ($conf_cache as $item){
Config::set([$item['set_name'] => $item['set_value']],$item['set_type']);
}
}
}