编辑系统设置
This commit is contained in:
1 parent
55b51a0d04
commit
8ba90a9ca4
5 files changed
+354
-229
No files matched your search
@@ -10,48 +10,72 @@ use app\system\model\SystemBase as sysbasemod;
|
||||
|
||||
class SystemBase extends Base
|
||||
{
|
||||
/**
|
||||
* 显示资源列表
|
||||
*
|
||||
* @return \think\Response
|
||||
*/
|
||||
// 系统设置
|
||||
public function index()
|
||||
{
|
||||
//实例化数据模型
|
||||
$sysbasemod = new sysbasemod();
|
||||
$count = 1;
|
||||
|
||||
// 查询最新记录
|
||||
$list = $sysbasemod
|
||||
->order(['id'=>'desc'])
|
||||
->field('keywords,description')
|
||||
->limit(1)
|
||||
->find();
|
||||
// 设置要给模板赋值的信息
|
||||
$list['title'] = '系统设置';
|
||||
$list['count'] = $count;
|
||||
|
||||
// 模版赋值
|
||||
// 模板赋值
|
||||
$this->assign('list',$list);
|
||||
|
||||
// 渲染输出
|
||||
|
||||
// 渲染模板
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
/**
|
||||
* 显示编辑资源表单页.
|
||||
*
|
||||
* @param int $id
|
||||
* @return \think\Response
|
||||
*/
|
||||
public function edit($id)
|
||||
|
||||
|
||||
// 系统设置列表
|
||||
public function ajaxData()
|
||||
{
|
||||
//
|
||||
// 获取DT的传值
|
||||
$getdt = request()->param();
|
||||
|
||||
//得到排序的方式
|
||||
$order = $getdt['order'][0]['dir'];
|
||||
//得到排序字段的下标
|
||||
$order_column = $getdt['order'][0]['column'];
|
||||
//根据排序字段的下标得到排序字段
|
||||
$order_field = $getdt['columns'][$order_column]['data'];
|
||||
//得到limit参数
|
||||
$limit_start = $getdt['start'];
|
||||
$limit_length = $getdt['length'];
|
||||
//得到搜索的关键词
|
||||
$search = $getdt['search']['value'];
|
||||
|
||||
|
||||
// 获取记录集总数
|
||||
$cnt = 1;
|
||||
//查询数据
|
||||
$data = sysbasemod::field('id,title,keywords,description,copyright,thinks,danwei')
|
||||
->order([$order_field=>$order])
|
||||
// ->limit(1,1)
|
||||
->select();
|
||||
|
||||
$datacnt = 1;
|
||||
|
||||
$data = [
|
||||
'draw'=> $getdt["draw"] , // ajax请求次数,作为标识符
|
||||
'recordsTotal'=>$datacnt, // 获取到的结果数(每页显示数量)
|
||||
'recordsFiltered'=>$cnt, // 符合条件的总数据量
|
||||
'data'=>$data, //获取到的数据结果
|
||||
];
|
||||
|
||||
return json($data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存更新的资源
|
||||
*
|
||||
* @param \think\Request $request
|
||||
* @param int $id
|
||||
* @return \think\Response
|
||||
*/
|
||||
|
||||
|
||||
// 编辑系统设置
|
||||
public function edit($id)
|
||||
{
|
||||
return 'aa';
|
||||
}
|
||||
|
||||
// 更新资源
|
||||
public function update(Request $request, $id)
|
||||
{
|
||||
//
|
||||
|
||||
Reference in new issue
Block a user