gpt4 book ai didi

CakePHP错误: An internal error has occurred

转载 作者:行者123 更新时间:2023-12-02 12:44:31 28 4
gpt4 key购买 nike

我在 cakephp 中有一些代码会产生错误。

这是 PHP Controller :

$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

这个错误是什么意思?

最佳答案

我在 core.php 中启用了 Debug模式:Configure::write('debug', 2);,它解决了我的问题。

关于CakePHP错误: An internal error has occurred,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20303117/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com