74 lines
1.7 KiB
PHP
Executable File
74 lines
1.7 KiB
PHP
Executable File
<?php
|
|
|
|
namespace app\admin\controller;
|
|
|
|
use \think\facade\Request;
|
|
use \think\facade\View;
|
|
use think\facade\Db;
|
|
|
|
|
|
class Config extends Base
|
|
{
|
|
public function base(Request $request)
|
|
{
|
|
$config = getConfig('base');
|
|
View::assign("key", "base");
|
|
View::assign("data", $config);
|
|
return View::fetch('Config/base');
|
|
}
|
|
|
|
//微信支付
|
|
public function weixinpay(Request $request)
|
|
{
|
|
$config = getConfig('weixinpay');
|
|
View::assign("key", "weixinpay");
|
|
View::assign("data", $config);
|
|
return View::fetch('Config/weixinpay');
|
|
}
|
|
|
|
//签到设置
|
|
public function sign(Request $request)
|
|
{
|
|
$config = getConfig('sign');
|
|
|
|
View::assign("key", "sign");
|
|
View::assign("data", $config);
|
|
return View::fetch('Config/sign');
|
|
}
|
|
|
|
//上传设置
|
|
public function uploads(Request $request)
|
|
{
|
|
$config = getConfig('uploads');
|
|
View::assign("key", "uploads");
|
|
View::assign("data", $config);
|
|
return View::fetch('Config/uploads');
|
|
}
|
|
|
|
//微信公众号
|
|
public function wechatofficialaccount(Request $request)
|
|
{
|
|
$config = getConfig('wechatofficialaccount');
|
|
View::assign("key", "wechatofficialaccount");
|
|
View::assign("data", $config);
|
|
return View::fetch('Config/weixinpay');
|
|
}
|
|
|
|
|
|
//修改
|
|
public function update()
|
|
{
|
|
$data = input("post.");
|
|
$data['update_time'] = time();
|
|
$result = setConfig($data['key'], $data);
|
|
if ($result) {
|
|
return $this->renderSuccess('修改成功');
|
|
} else {
|
|
return $this->renderError('修改失败');
|
|
}
|
|
}
|
|
|
|
|
|
}
|
|
|
|
?>
|