Class 'think\db\View' not found

浏览:755 发布日期:2020/06/07 分类:ThinkPHP6专区 关键字: tp6
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,希望官方给的正解!!!
最佳答案
评论() 相关
后面还有条评论,点击查看>>