diff --git a/application/common/controller/Base.php b/application/common/controller/Base.php new file mode 100644 index 00000000..d08c6a82 --- /dev/null +++ b/application/common/controller/Base.php @@ -0,0 +1,14 @@ +order(['id'=>'desc']) + ->field('title,keywords,description') + ->limit(1) + ->find(); + + // 获取版本号 + $list->version = config('version'); + + // 模版赋值 + $this->assign('list',$list); + + // $url = url('welcome'); + // halt($url); + + // 渲染输出 return $this->fetch(); } public function welcome() { + //实例化数据模型 + $sysbasemod = new sysbasemod(); + + // 查询最新记录 + $list = $sysbasemod + ->order(['id'=>'desc']) + ->field('title,copyright,thinks') + ->limit(1) + ->find(); + + // 获取版本号 + $list->version = config('version'); + + // 模版赋值 + $this->assign('list',$list); + + // $url = url('welcome'); + // halt($url); + + // 渲染输出 return $this->fetch(); } } diff --git a/application/index/view/index/index.html b/application/index/view/index/index.html index ad4b6cea..253f9c4f 100644 --- a/application/index/view/index/index.html +++ b/application/index/view/index/index.html @@ -25,15 +25,15 @@ -H-ui.admin v3.1 - - +{$list.title} + +