创建student和system模块修改主页与欢迎页内容为动态
This commit is contained in:
1 parent
b881bdfef6
commit
663cafe365
17 files changed
+432
-17
No files matched your search
@@ -0,0 +1,102 @@
|
||||
<?php
|
||||
|
||||
namespace app\system\controller;
|
||||
|
||||
// 引用控制器基类
|
||||
use app\common\controller\Base;
|
||||
// 引用与此控制器同名的数据模型
|
||||
use app\system\model\SystemBase as sysbasemod;
|
||||
|
||||
|
||||
class SystemBase extends Base
|
||||
{
|
||||
/**
|
||||
* 显示资源列表
|
||||
*
|
||||
* @return \think\Response
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
//实例化数据模型
|
||||
$sysbasemod = new sysbasemod();
|
||||
|
||||
// 查询最新记录
|
||||
$list = $sysbasemod
|
||||
->order(['id'=>'desc'])
|
||||
->field('keywords,description')
|
||||
->limit(1)
|
||||
->find();
|
||||
|
||||
// 模版赋值
|
||||
$this->assign('list',$list);
|
||||
|
||||
// 渲染输出
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
/**
|
||||
* 显示创建资源表单页.
|
||||
*
|
||||
* @return \think\Response
|
||||
*/
|
||||
public function create()
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存新建的资源
|
||||
*
|
||||
* @param \think\Request $request
|
||||
* @return \think\Response
|
||||
*/
|
||||
public function save(Request $request)
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* 显示指定的资源
|
||||
*
|
||||
* @param int $id
|
||||
* @return \think\Response
|
||||
*/
|
||||
public function read($id)
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* 显示编辑资源表单页.
|
||||
*
|
||||
* @param int $id
|
||||
* @return \think\Response
|
||||
*/
|
||||
public function edit($id)
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存更新的资源
|
||||
*
|
||||
* @param \think\Request $request
|
||||
* @param int $id
|
||||
* @return \think\Response
|
||||
*/
|
||||
public function update(Request $request, $id)
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除指定资源
|
||||
*
|
||||
* @param int $id
|
||||
* @return \think\Response
|
||||
*/
|
||||
public function delete($id)
|
||||
{
|
||||
//
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user