Cakephp错误:发生了内部错误
发布时间:2020-12-13 18:28:14 所属栏目:PHP教程 来源:网络整理
导读:我在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 = $th
我在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中,它解决了我的问题.
(编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |