tp6查询数据报错:Class 'think\db\View' not found
查询代码:AdminRule::where(['mca' => $mca])->find()
AdminRule是model文件夹的类:里面代码为空,继承的think\Model
在线请教,这种情况该如何解决!!!
目前找到的原因:
/**
* 获得数据集数组
* @access protected
* @param bool $procedure 是否存储过程
* @return array
*/
protected function getResult(bool $procedure = false): array
{
if ($procedure) {
// 存储过程返回结果
return $this->procedure();
}
$result = $this->PDOStatement->fetchAll(View::fetchType);
$this->numRows = count($result);
return $result;
}
个人觉得这个方法有问题,将View::fetchType改成$this->fetchType就可以正常操作数据库,不知道是我使用方法有误还是无意中发现了一个BUG,希望官方给的正解!!!