91 lines
2.5 KiB
PHP
Raw Normal View History

2024-09-29 15:43:18 +08:00
<?php
// +----------------------------------------------------------------------
// | ThinkAdmin
// +----------------------------------------------------------------------
// | 版权所有 2014~2019 广州楚才信息科技有限公司 [ http://www.cuci.cc ]
// +----------------------------------------------------------------------
// | 官方网站: http://demo.thinkadmin.top
// +----------------------------------------------------------------------
// | 开源协议 ( https://mit-license.org )
// +----------------------------------------------------------------------
// | gitee 代码仓库https://gitee.com/zoujingli/ThinkAdmin
// | github 代码仓库https://github.com/zoujingli/ThinkAdmin
// +----------------------------------------------------------------------
namespace app\setting\controller;
use think\admin\Controller;
/**
* 系统配置
* Class App
* @package app\setting\controller
*/
class Config extends Controller
{
/**
* 更新配置
* @auth true
* @login true
* @menu true
* @throws \think\Exception
* @throws \think\exception\PDOException
*/
public function index()
{
$this->title = '系统配置';
$system_order_perfix = sysconf('system_order_perfix');
if (!$system_order_perfix) {
sysconf('system_order_perfix', 'Q');
}
$settingStatus = sysconf('settingStatus');
if (!$settingStatus) {
sysconf('settingStatus', 2);
}
$settingUpdate = sysconf('settingUpdate');
if (!$settingUpdate) {
sysconf('settingUpdate', 2);
}
$queue = sysconf('queue');
if (!$queue) {
sysconf('queue', 1);
}
$order_name = sysconf('order_name');
if (!$order_name) {
sysconf('order_name', 's_nubmer');
}
$sign_type = sysconf('sign_type');
if (!$sign_type) {
sysconf('sign_type', 1);
}
$no_account_merchant = sysconf('no_account_merchant');
if (!$no_account_merchant) {
sysconf('no_account_merchant', '2');
}
$this->fetch();
}
/**
* 保存配置
* @auth true
* @login true
* @menu true
* @throws \think\Exception
* @throws \think\exception\PDOException
*/
public function save()
{
if ($this->request->isPost()) {
foreach ($this->request->post() as $k => $v) sysconf($k, $v);
$this->success('更新系统配置成功!');
}
}
}