从to更新Zend 1.12.1
到1.12.3
并x_debug on
制作OLD_PASSWORD
.default
我重新运行了一个曾经无缝运行的程序,现在它有一个致命的PDOException
,详细信息如下:
错误:
SQLSTATE[42S22]: Column not found: 1054 Unknown column 'place_fcb.userid' in 'group statement'
实际 SQL 查询:
SELECT `C`.*
FROM (SELECT `place_fcb`.* FROM `place_fcb`)
AS `C`
WHERE (place_type_id != '176')
GROUP BY place_fcb.userid
HAVING (place_fcb.pda >= '2009-12-21')
AND (place_fcb.pda <= '2010-01-20')
Zend_Db_table_Abstract:
public function getPlacefcb($start_date = '', $end_date = '', $r_id = '')
{
$sub_sql = $this->select()->from('place_fcb');
$select = $this->select()
->setIntegrityCheck(false)
->from(array('C' => new Zend_Db_Expr('('.$sub_sql.')')))
->where("place_type_id != '176'")
->group('place_fcb.userid');
if($start_date != '')
$select->having('`place_fcb`.`pda` >= ?', $start_date);
if($end_date != '')
$select->having('`place_fcb`.`pda` <= ?', $end_date);
if($region_id != '')
$select->having('`place_fcb`.`r_id` = ?', $r_id);
return $rowset = $this->fetchAll($select);
}
place_fcb 的 MySQL:
place_fcb 是一个视图而不是一个表。它有以下相关领域
place_id
r_id
place_type_id
pda
userid
我可以通过将 SQl 语句更改为:删除异常并返回相同的结果:
SELECT `C`.*
FROM (SELECT `place_fcb`.* FROM `place_fcb`)
AS `C`
WHERE (place_type_id != '176')
GROUP BY userid
HAVING (pda >= '2009-12-21')
AND (pda <= '2010-01-20')
IE。删除所有表后缀...
但是我将如何用 Zend 修复它?为什么会突然出错?