当我尝试在查询构建器中调用COALESCE函数时,它会显示致命错误
调用数组“。
上的成员函数func()
这是我的代码
$query = $this->Ticket->find();
$condition = array(
'AND' => array(
'Ticket.owner' => $query->func()->COALESCE($owner,'owner'),
'Ticket.status' => $query->func()->COALESCE($status,'status'),
'Ticket.updatedTime >=' => $query->func()->COALESCE($dateFrom,'updatedTime'),
'Ticket.updatedTime <=' => $query->func()->COALESCE($dateTo,'updatedTime')
)
);
$this->paginate = array(
'limit' => 10,
'order' =>'Ticket.updatedTime desc',
'conditions' => $condition
);