Error message
controller Admin.php页面 <?php namespace app\admin\controller; use app\admin\common\Base; use think\Request; use app\admin\model\AdminModel; class Admin extends Base { //显示管理员首页 public function index() { //1.读取admin管理员表的信息 $admin = AdminModel::get(['username'=> 'admin']); //2.将当前管理员的信息赋值给模板 $this -> view -> assign('admin', $admin); //3.渲染模板 return $this -> view -> fetch('admin_list'); } }
Model AdminModel.php
<?php namespace app\admin\model; use think\Model; class AdminModel extends Model { //创建获取器方法,用来实现时间的转换 public function getLastTimeAttr($val) { return date('Y/m/d', $val); } //创建修改器,将密码自动md5加密存储 public function setPasswordAttr($val) { return md5($val); } }
Who can help me?
The admin_model table in the qiye database does not exist, please check it yourself.