<?php

namespace App\Modules\Sys\Services;

use App\Modules\Sys\Models\SysConfig;

class SysConfigService
{
    //公共方法-获取
    static function getValueByName($name)
    {
        return SysConfig::getValueByName($name);
    }

    //公共方法-设置
    static function setValueByName($name,$value)
    {
        return SysConfig::setValueByName($name,$value);
    }

    /**
     * 获取强制行为数据开关
     * *
     */
    static function getForceActiveSwitch()
    {
        return self::getValueByName('FORCE_ACTIVE_SWITCH');
    }

    /**
     * 开启强制行为数据开关
     * *
     */
    static function openForceActiveSwitch()
    {
        return self::setValueByName('FORCE_ACTIVE_SWITCH',1);
    }

    /**
     * 关闭强制行为数据开关
     * *
     */
    static function closeForceActiveSwitch()
    {
        return self::setValueByName('FORCE_ACTIVE_SWITCH',0);
    }
}
