/** * @usage 获取project_id 成功则返回id, 失败返回false,表示已经完成这一层,抛出异常则下层没有完成 * @param int $examinee_id * @throws Exception */ private static function getProjectId($examinee_id) { $examinee_info = Examinee::findFirst(array("id = :id:", 'bind' => array('id' => $examinee_id))); #如果examinee_id为空,这种处理也合适 if (isset($examinee_info->state)) { if ($examinee_info->state == 3) { self::$project_id = $examinee_info->project_id; return true; } else { if ($examinee_info->state <= 2) { throw new Exception(self::$error_state . '-下层计算还未完成-' . $examinee_info->state); } else { return false; } } } else { throw new Exception(self::$error_state . '-不存在该账号的用户-' . $examinee_id); } }