创建student和system模块修改主页与欢迎页内容为动态

This commit is contained in:
巴掌 committed 2018-10-10 10:56:54 +08:00
1 parent b881bdfef6
commit 663cafe365
17 files changed
+432 -17

No files matched your search

+10
View File
@@ -0,0 +1,10 @@
<?php
namespace app\system\controller;
class Index
{
public function index()
{
return '<style type="text/css">*{ padding: 0; margin: 0; } div{ padding: 4px 48px;} a{color:#2E5CD5;cursor: pointer;text-decoration: none} a:hover{text-decoration:underline; } body{ background: #fff; font-family: "Century Gothic","Microsoft yahei"; color: #333;font-size:18px;} h1{ font-size: 100px; font-weight: normal; margin-bottom: 12px; } p{ line-height: 1.6em; font-size: 42px }</style><div style="padding: 24px 48px;"> <h1>:) </h1><p> ThinkPHP V5.1<br/><span style="font-size:30px">12载初心不改(2006-2018) - 你值得信赖的PHP框架</span></p></div><script type="text/javascript" src="https://tajs.qq.com/stats?sId=64890268" charset="UTF-8"></script><script type="text/javascript" src="https://e.topthink.com/Public/static/client.js"></script><think id="eab4b9f840753f8e7"></think>';
}
}
@@ -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)
{
//
}
}