以下是被执行的代码:
$areas = $this->builder->from(‘area‘) ->where(‘aid = 0‘) ->getQuery() ->execute() ->toArray(); $this->view->setVar(‘areas‘, $areas);
经过研究才发现原来where里面的字段要带着表名的,正确代码:
$areas = $this->builder->from(‘area‘) ->where(‘area.aid = 0‘) ->getQuery() ->execute() ->toArray(); $this->view->setVar(‘areas‘, $areas);
Can't obtain the model 'aid' source from the _models list
时间: 2024-11-09 00:48:40