first commit
This commit is contained in:
38
金壶/ydyd_service/application/common/SystemDeal.php
Normal file
38
金壶/ydyd_service/application/common/SystemDeal.php
Normal file
@@ -0,0 +1,38 @@
|
||||
<?php
|
||||
namespace app\common;
|
||||
use think\facade\Cache;
|
||||
use think\Db;
|
||||
|
||||
class SystemDeal
|
||||
{
|
||||
public function initConstant()
|
||||
{
|
||||
//初始化系统常量
|
||||
$system_constant = Cache::get("SYSTEM_CONSTANT");
|
||||
if (!$system_constant) {
|
||||
$list = Db::name('constants')->column("param_value","param_name");
|
||||
$system_constant = array();
|
||||
foreach ($list as $k => $v) {
|
||||
$system_constant[$k] = json_decode($v,true);
|
||||
}
|
||||
Cache::set('SYSTEM_CONSTANT', $system_constant,120);
|
||||
}
|
||||
config('SYSTEM_CONSTANT',$system_constant);
|
||||
}
|
||||
|
||||
//初始化短信常量
|
||||
/*public function initSmsConstant()
|
||||
{
|
||||
//初始化系统常量
|
||||
$sms_constant = Cache::get("SMS_CONSTANT");
|
||||
if (!$sms_constant) {
|
||||
$list = Db::name('constants')->column("param_value","param_name");
|
||||
$system_constant = array();
|
||||
foreach ($list as $k => $v) {
|
||||
$system_constant[$k] = json_decode($v,true);
|
||||
}
|
||||
Cache::set('SYSTEM_CONSTANT', $system_constant,120);
|
||||
}
|
||||
config('SYSTEM_CONSTANT',$system_constant);
|
||||
}*/
|
||||
}
|
||||
Reference in New Issue
Block a user