<?php
namespace app\admins\controller;
use think\Controller;
use Util\data\Sysdb;
class Test extends Controller
{
public function index(){
$this->db = new Sysdb ;
$res = $this->db->table('admins')->field('id,username')->lists();
dump ($res);
}
}
will show that the web page cannot operate. If you remove the extends Controller, this error will not be reported
Are you tp6 or 5? tp6 inherits BaseController
I reported this error, and I have turned on the debug mode
What error will be reported? Let’s take a look at the screenshots