我在cakePHP中有一些代码会产生错误.
这是PHP控制器:
$this->loadModel( 'Vote' ); //Newly added by amit start
$Vote=$this->Vote->getVote($id,$uid);
$this->set('Vote',$Vote);
$VoteCount = count($Vote);
$this->set('VoteCount',$VoteCount);
$VoteShow = $this->Vote->find('all',array(
'fields' => array('SUM(Vote.score) AS score','count(id) as countId'),'conditions'=>array('Vote.type_id'=>$id),));
$this->set('VoteShow',$VoteShow);
模型:
public function getVote($id,$uid) {
if (empty($conditions))
$conditions = array('Vote.type' => 'blog','Vote.type_id' => $id,'Vote.user_id' => $uid);
$users = $this->find('all',array('conditions' => $conditions,'order' => 'Vote.id desc'
));
return $users;
}
该代码产生此错误:
Error : An internal error has occurred
这个错误是什么意思?
我启用了调试模式:Configure :: write(‘debug’,2);在core.PHP中,它解决了我的问题.