You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

61 lines
1.1 KiB

<?php
declare (strict_types=1);
/**
* Created by 安徽云掌.
* User: 云掌.帮德
* Date: 2020/3/8 22:30
* Desc: 行为日志类
*/
namespace app\api\controller;
use think\App;
class SiteTemplate extends Common
{
public $model = null;
public function __construct(App $app)
{
parent::__construct($app);
$this->model = new \app\api\model\SiteTemplate();
}
/**
* 显示资源列表
*
* @return \think\Response
*/
public function index()
{
//接受参数
$_get = $this->request->get();
//数据处理
$_data = $this->model->index();
//返回数据
return send_http_status($_data);
}
public function change()
{
//接收参数
$ids = $this->request->param('id');
//验证参数
$_rules = [
'id' => 'require|length:1,100'
];
validate($_rules)->check(['id' => $ids]);
//处理并返回数据
return send_http_status('', $this->model->changeDefaultTemplate() !== false ? 207 : 208);
}
}