本文整理汇总了PHP中Fn::getParam方法的典型用法代码示例。如果您正苦于以下问题:PHP Fn::getParam方法的具体用法?PHP Fn::getParam怎么用?PHP Fn::getParam使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Fn
的用法示例。
在下文中一共展示了Fn::getParam方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: updateclass
/**
* 保存新增/编辑班级数据
*/
public function updateclass()
{
$schcls_schid = Fn::getParam('schcls_schid');
$schcls_id = Fn::getParam('schcls_id');
if (!$schcls_schid && !$schcls_id) {
message('参数错误');
}
$schcls_name = Fn::getParam('schcls_name');
if (!$schcls_name) {
message('班级名称不能为空');
}
$param = array();
$param['schcls_name'] = trim($schcls_name);
try {
//编辑
if ($schcls_id) {
$class = SchoolModel::schoolClassInfo($schcls_id);
if (!$class) {
message('班级不存在');
}
$schcls_schid = $class['schcls_schid'];
$param['schcls_id'] = $schcls_id;
$result = SchoolModel::setSchoolClass($param);
if ($result) {
admin_log('edit', 'school_class', $schcls_id);
}
} else {
$param['schcls_schid'] = $schcls_schid;
$result = SchoolModel::addSchoolClass($param);
if ($result) {
admin_log('edit', 'school_class', $result);
}
}
message($result ? '操作成功' : '操作失败', '/admin/school/classlist/' . $schcls_schid);
} catch (Exception $e) {
message($e->getMessage());
}
}
示例2: seltclist
/**
* 选择培训机构校区列表
* @param int $ti_id = NULL 培训机构ID,若为NULL表示查询所有,否则
* 表示只查询该机构ID所指校区
* @param int multisel GET参数,若为1表多选,否则表单选
*/
public function seltclist($ti_id = NULL)
{
$param = array();
$ti_id = intval($ti_id);
if ($ti_id) {
$ti_info = TrainingInstitutionModel::trainingInstitutionInfo($ti_id);
if ($ti_info) {
$param['tc_tiid'] = $ti_id;
}
} else {
$ti_info = array();
}
if (isset($_GET['page'])) {
$page = intval($_GET['page']);
if ($page < 1) {
$page = 1;
}
} else {
$page = 1;
}
$param['order_by'] = 'tc_tiid, tc_provid, tc_cityid, tc_areaid, tc_id';
$tc_id = Fn::getParam('tc_id');
if (Validate::isJoinedIntStr($tc_id)) {
$param['tc_id'] = $tc_id;
}
$data = array();
$data['ti_info'] = $ti_info;
$data['tc_list'] = TrainingInstitutionModel::trainingCampusList('*', $param, $page);
$data['tc_list_count'] = TrainingInstitutionModel::trainingCampusListCount($param);
$this->load->view('traininginstitution/seltclist', $data);
}
示例3: setexamrelatequestion
public function setexamrelatequestion($erq_examid, $erq_zmoss_examid)
{
$erq_examid = intval($erq_examid);
$erq_zmoss_examid = intval($erq_zmoss_examid);
$paper_id = intval(Fn::getParam('er_paperid'));
$exam = ExamModel::get_exam($erq_examid);
if (!$exam['exam_pid']) {
message('请指定需要设置试题对应的考试学科!');
}
$examrelate = ZmossModel::examRelateInfo($erq_examid, $erq_zmoss_examid);
if (!$examrelate) {
message('此考试学科没有对应关系,无法设置试题关系!');
}
$zmossquestion = ZmossModel::examQuestionList($examrelate['er_zmoss_examid']);
if (!$zmossquestion) {
message('此考试学科对应阅卷系统的考试没有试题,无法设置试题关系!');
}
$paperlist = ExamPaperModel::examSubjectPaperList($erq_examid);
if (!$paperlist) {
message('此考试学科没有设置考试试卷,无法设置试题关系!');
}
if ($paper_id) {
$paper = $paperlist[$paper_id];
}
if (!$paper) {
$paper = current($paperlist);
}
/*
$paperquestion = ExamPaperModel::examPaperQuestion(
$paper['paper_id'], 'q.ques_id, q.parent_id, q.type, IFNULL(pq.type, q.type) AS p_type',
'AND q.is_parent = 0', 'ORDER BY p_type ASC, q.parent_id ASC, q.ques_id ASC');
*/
$question = json_decode($paper['question_sort'], true);
$paperquestion = array();
foreach ($question as $k => $ques_id) {
$info = QuestionModel::get_question($ques_id);
$list = QuestionModel::get_children($ques_id);
if ($list) {
foreach ($list as $key => $val) {
$paperquestion[$val['ques_id']] = array('ques_id' => $val['ques_id'], 'type' => $info['type'], 'parent_id' => $ques_id);
}
} else {
$paperquestion[$ques_id] = array('ques_id' => $ques_id, 'type' => $info['type']);
}
}
$examrelatequestion = ZmossModel::examRelateQuestionInfo($erq_examid, $erq_zmoss_examid, $paper['paper_id']);
$erq_relate_data = array();
if ($examrelatequestion) {
$erq_relate_data = json_decode($examrelatequestion['erq_relate_data'], true);
}
$data['examrelatequestion'] = $erq_relate_data;
$data['examrelate'] = $examrelate;
$data['paperquestion'] = $paperquestion;
$data['zmossquestion'] = $zmossquestion;
$data['qtype'] = C('qtype');
$data['paperlist'] = $paperlist;
$this->load->view('zmoss/setexamrelatequestion', $data);
}