这代码一直报错500 看了好久没看出来,各位大神帮我看看哪里有问题
function notify_faka($payno){
$pay = db('pay')->where(['payno' => $payno])->find();
$cak = db('cak')->where(['user' => $payno])->select();
$i = 0; foreach ($cak as $rows) {
if($rows['time']+5*60 < time()){
if(db('cak')->where(['user' => $payno])->updata(['staus' => '1'],true)){
$data[$i] = $rows['content'];
$i++;
}
}
} if($i >= $pay['value']){ if(db('pay')->where(['payno' => $payno])->updata(['cak' => mcrypt()->encrypt(json_encode($data),_AppKey_)],true)){
return true;
}else{
return false;
}

}else{
return false;
}
}