function countRecommend() { header('Content-type: application/json'); $user_id = (int) getvar('user_id', 'post'); $rebate = new Rebate(); $result = $rebate->countRecommend($user_id); if ($result) { echo json_encode($result); } else { echo 'false'; } }