我已将我的服务设置为cron-job但cron作业返回“crone-job中的0未指定响应代码”,当我运行此服务到我的浏览器工作时请告诉我如何解决此问题我的代码是< / p>
function autoUpdateUserSpinz() {
header('Content-type: application/json; charset=utf-8');
$spinz = 0;
//$user_id = $_POST['user_id'];
$userSpinz = $this->mdl_file->getAllUserSpinz();
foreach($userSpinz as $value) {
$value['user_id'];
$value['user_spinz'];
if($value['user_spinz'] == 5) {
$spinz = 5;
} else {
$spinz = $value['user_spinz'] + 1;
}
$this->mdl_file->updateUserSpinz($spinz,$value['user_id']);
}
}
public function updateUserSpinz($spinz, $user_id) {
$this->db->query("UPDATE sz_users SET user_spinz= $spinz where user_id = $user_id");
}