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.將當(dāng)前管理員的信息賦值給模板 $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 { //創(chuàng)建獲取器方法,用來實(shí)現(xiàn)時(shí)間的轉(zhuǎn)換 public function getLastTimeAttr($val) { return date('Y/m/d', $val); } //創(chuàng)建修改器,將密碼自動(dòng)md5加密存儲(chǔ) 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.