我在下面的函数中不断收到此错误,不知道我做错了什么,试图将单个逗号更改为double但仍然存在错误。请协助。
public function atAssessed($year, $month, $region)
{
$select = $this->select()
->from($this, array('COUNT(*) as assessed, MONTH(assd_date) as month'))
->where('assd = ?', 1)
->where('assd_date >= ?', ($year - 1) . '-' . ($month + 1) . '-01')
->group('MONTH(assd_date)')
->order('assd_date');
($region != 0 ? $select->where('region = ?', $region) : '');
return $this->fetchAll($select);
}
下方的完整错误消息
消息:SQLSTATE [42S22]:找不到列:1054未知列 在'字段列表'中'enterprise.COUNT(*)已评估,MONTH(assd_date)', 查询是:SELECT
enterprise
。COUNT(*) as assessed, MONTH(assd_date)
ASmonth
FROMenterprise
WHERE(assd = 1)AND (assd_date> ='2013-13-01')GROUP BY MONTH(assd_date)ORDER BYassd_date
ASC