我想使用 zf2 从第一个和第二个表中选择字段进行简单的连接,但是当我尝试将字段数组放入 columns 方法时出现错误(“无法执行语句”)。
public function fetchAll()
{
$resultSet = $this->tableGateway->select(function (Select $select) {
$select->columns();// ->with params gives an 'Statement could not be executed'
$select->join(array('t2' => 'categories'), 'table1.idCategory = t2.id');
$select->order('dateTime DESC')->limit(100);
});
...
}