当前位置: 首页>>代码示例>>PHP>>正文


PHP Func::param_copy方法代码示例

本文整理汇总了PHP中Func::param_copy方法的典型用法代码示例。如果您正苦于以下问题:PHP Func::param_copy方法的具体用法?PHP Func::param_copy怎么用?PHP Func::param_copy使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Func的用法示例。


在下文中一共展示了Func::param_copy方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: setTransactionRecordByTrNo

 /**
  * 根据交易号修改交易记录
  * @param   string  $tr_id  交易号
  * @param   array   $param  map<string, variant>类型的新记录
  *                          int     $param['tr_money']  择明通宝余额
  *                          int     $param['tr_cash']   充值金额
  *                          int     $param['tr_trade_amount']   交易金额
  *                          string  $param['tr_comment'] 交易说明
  *                          int     $param['tr_flag']   交易状态
  * @return  boolean  true|false
  */
 public static function setTransactionRecordByTrNo($tr_no, $param)
 {
     if (!$tr_no) {
         return false;
     }
     $param = Func::param_copy($param, 'tr_money', 'tr_cash', 'tr_trade_amount', 'tr_comment', 'tr_flag', 'tr_finishtime');
     return Fn::db()->update('t_transaction_record', $param, 'tr_no = ?', array($tr_no));
 }
开发者ID:Vincent-Shen,项目名称:origin,代码行数:19,代码来源:TransactionRecord.php

示例2: setConvert2pdfStatus

 /**
  * 设置评估规则生成html的状态
  */
 public static function setConvert2pdfStatus($param)
 {
     $param = Func::param_copy($param, 'rule_id', 'html_status', 'is_success', 'status', 'num');
     if (!Validate::isInt($param['rule_id']) || $param['rule_id'] <= 0) {
         throw new Exception('请指定评估规则!');
     }
     return Fn::db()->update('rd_convert2pdf', $param, "rule_id = " . $param['rule_id']);
 }
开发者ID:Vincent-Shen,项目名称:origin,代码行数:11,代码来源:ReportCommand.php

示例3: setTCFunc

 /**
  * 新增/编辑校区AJAX方法
  * @param   array   $param  map<string,variant>类型参数
  *                  int     tc_id   ID,若为0表新增
  *                  int     tc_tiid 所属培训机构ID
  *                  string  tc_name 名称
  *                  int     tc_flag 状态,-1已删 0禁用 1启用 大于1待审
  *                  int     tc_environ  环境指数
  *                  int     tc_provid   地址省
  *                  int     tc_cityid   地址市
  *                  int     tc_areaid   地址区县
  *                  string  tc_ctcaddr  联系地址
  *                  string  tc_ctcperson    联系人
  *                  string  tc_ctcphone     联系电话
  */
 public function setTCFunc($param)
 {
     $resp = new AjaxResponse();
     $param = Func::param_copy($param, 'tc_id', 'tc_name', 'tc_tiid', 'tc_flag', 'tc_environ', 'tc_provid', 'tc_cityid', 'tc_areaid', 'tc_ctcaddr', 'tc_ctcperson', 'tc_ctcphone');
     if ($param['tc_name'] == '') {
         $resp->alert('培训校区名称不可为空');
         return $resp;
     }
     if (!Validate::isInt($param['tc_provid']) || $param['tc_provid'] < 1) {
         $resp->alert('请选择校区所在省');
         return $resp;
     }
     if ($param['tc_ctcaddr'] == '') {
         $resp->alert('请填写联系地址');
         return $resp;
     }
     if ($param['tc_ctcperson'] == '') {
         $param['tc_ctcperson'] = NULL;
     }
     if ($param['tc_ctcphone'] == '') {
         $resp->alert('请填写联系电话');
         return $resp;
     }
     if (!Validate::isInt($param['tc_environ'])) {
         $reps->alert('请填写环境指数');
         return $resp;
     }
     try {
         if ($param['tc_id']) {
             unset($param['tc_tiid']);
             TrainingInstitutionModel::setTrainingCampus($param);
             admin_log('edit', 'trainingcampus', "tc_id: " . $param['tc_id']);
         } else {
             $param['tc_id'] = TrainingInstitutionModel::addTrainingCampus($param);
             admin_log('add', 'trainingcampus', "tc_id: " . $param['tc_id']);
         }
         $resp->redirect('/admin/traininginstitution/tcinfo/' . $param['tc_id']);
     } catch (Exception $e) {
         $resp->alert($e->getMessage());
     }
     return $resp;
 }
开发者ID:Vincent-Shen,项目名称:origin,代码行数:57,代码来源:traininginstitution.php

示例4: setCTeacher

 /**
  * 修改教师
  * @param   array   map<string, variant>类型的参数
  *                  int         ct_id
  *                  string      ct_name 
  *                  string      ct_contact
  *                  int         ct_flag
  *                  string      ct_memo
  *                  list<int>   gradeid_list
  *                  list<int>   subjectid_list
  *                  list<int>   cct_ccid_list
  * @return  int     若成功返回非0,若失败返回0
  */
 public static function setCTeacher(array $param)
 {
     $param = Func::param_copy($param, 'ct_id', 'ct_name', 'ct_contact', 'ct_flag', 'gradeid_list', 'subjectid_list', 'cct_ccid_list', 'ct_memo');
     if (!isset($param['ct_id']) || !Validate::isInt($param['ct_id'])) {
         throw new Exception('教师ID不正确');
     }
     if (count($param) == 1) {
         throw new Exception('没有任何要修改的内容');
     }
     if (isset($param['ct_name']) && !Validate::isStringLength($param['ct_name'], 1, 30)) {
         throw new Exception('教师名称不能为空且长度最多30个字符');
     }
     if (isset($param['ct_flag']) && !Validate::isInt($param['ct_flag'])) {
         throw new Exception('教师状态标志必须为整数');
     }
     if (isset($param['ct_contact'])) {
         if ($param['ct_contact'] == '') {
             $param['ct_contact'] = NULL;
         } else {
             if (!Validate::isStringLength($param['ct_contact'], 1, 255)) {
                 throw new Exception('教师联系方式最多255个字符');
             }
         }
     }
     if (isset($param['ct_memo'])) {
         if ($param['ct_memo'] == '') {
             $param['ct_memo'] = NULL;
         }
     }
     $gradeid_list = NULL;
     if (isset($param['gradeid_list'])) {
         if (!is_array($param['gradeid_list'])) {
             throw new Exception('年级参数类型不正确');
         }
         $param['gradeid_list'] = array_values($param['gradeid_list']);
         $param['gradeid_list'] = array_unique($param['gradeid_list']);
         foreach ($param['gradeid_list'] as $v) {
             if (!Validate::isInt($v)) {
                 throw new Exception('年级ID必须为整数');
             }
         }
         $gradeid_list = $param['gradeid_list'];
         unset($param['gradeid_list']);
         if (empty($gradeid_list)) {
             throw new Exception('年级ID必须填写');
         }
     }
     $subjectid_list = NULL;
     if (isset($param['subjectid_list'])) {
         if (!is_array($param['subjectid_list'])) {
             throw new Exception('学科参数类型不正确');
         }
         $param['subjectid_list'] = array_values($param['subjectid_list']);
         $param['subjectid_list'] = array_unique($param['subjectid_list']);
         foreach ($param['subjectid_list'] as $v) {
             if (!Validate::isInt($v)) {
                 throw new Exception('学科ID必须为整数');
             }
         }
         $subjectid_list = $param['subjectid_list'];
         unset($param['subjectid_list']);
         if (empty($subjectid_list)) {
             throw new Exception('学科ID必须填写');
         }
     }
     $ccid_list = NULL;
     if (isset($param['cct_ccid_list'])) {
         if (!is_array($param['cct_ccid_list'])) {
             throw new Exception('课程参数类型不正确');
         }
         $param['cct_ccid_list'] = array_values($param['cct_ccid_list']);
         $param['cct_ccid_list'] = array_unique($param['cct_ccid_list']);
         foreach ($param['cct_ccid_list'] as $v) {
             if (!Validate::isInt($v)) {
                 throw new Exception('课程ID必须为整数');
             }
         }
         $ccid_list = $param['cct_ccid_list'];
         unset($param['cct_ccid_list']);
     }
     $ct_id = $param['ct_id'];
     unset($param['ct_id']);
     $db = Fn::db();
     $bOk = false;
     if ($db->beginTransaction()) {
         $db->update('t_cteacher', $param, "ct_id = {$ct_id}");
         if (is_array($gradeid_list)) {
//.........这里部分代码省略.........
开发者ID:Vincent-Shen,项目名称:origin,代码行数:101,代码来源:CTeacher.php

示例5: baseFetchCTeacherListFunc

    public function baseFetchCTeacherListFunc($param)
    {
        $resp = new AjaxResponse();
        $param = Func::param_copy($param, 'grade_id', 'cteacher_name', 'cors_id');
        $grade_id = $param['grade_id'];
        unset($param['grade_id']);
        if (empty($param['cors_id'])) {
            $resp->alert('请选择培训课程');
            return $resp;
        }
        if (empty($param['cteacher_name'])) {
            unset($param['cteacher_name']);
        }
        try {
            $cors_id = $param['cors_id'];
            $sql = <<<EOT
SELECT ct_id, ct_name FROM v_course_campus_teacher WHERE cct_ccid IN (
    SELECT cc_id FROM t_course_campus WHERE cc_corsid = {$cors_id}
)
EOT;
            $ct_map = Fn::db()->fetchPairs($sql);
            if (!empty($ct_map)) {
                $ct_id_list = array_keys($ct_map);
                $ct_id_str = implode(',', $ct_id_list);
                $sql = <<<EOT
SELECT DISTINCT ctg_ctid FROM t_cteacher_gradeid 
WHERE ctg_ctid IN ({$ct_id_str}) AND (ctg_gradeid = 0 OR ctg_gradeid = {$grade_id})
EOT;
                $ct_id2 = Fn::db()->fetchCol($sql);
                $ct_list = array();
                foreach ($ct_map as $k => $v) {
                    if (in_array($k, $ct_id2)) {
                        $ct_list[] = array('ct_id' => $k, 'ct_name' => $v);
                    }
                }
                $resp->call('fnSetCTeacherListDiv', $ct_list);
            } else {
                $resp->call('fnSetCTeacherListDiv', array());
            }
        } catch (Exception $e) {
            $resp->alert($e->getMessage());
        }
        return $resp;
    }
开发者ID:Vincent-Shen,项目名称:origin,代码行数:44,代码来源:student.php

示例6: setProfession

 /**
  * 编辑职业,成功返回非0,失败返回0
  * $param为array,则为map<string, variant>,参数如下:
  *          int     profession_id       职业id
  *          string  profession_name     职业名称
  *          int     profession_emerging 新兴职业(0-否 1-是)
  *          string  profession_explain  职业说明
  * @return  mixed
  */
 public static function setProfession($param)
 {
     $param = Func::param_copy($param, 'profession_id', 'profession_name', 'profession_emerging', 'profession_explain');
     if (!Validate::isNotEmpty($param['profession_name'])) {
         throw new Exception('职业名称不能为空!');
     }
     $db = Fn::db();
     $sql = "SELECT profession_id FROM t_profession\n                WHERE profession_name = ? AND profession_id <> ?";
     if ($db->fetchOne($sql, array($param['profession_name'], $param['profession_id']))) {
         throw new Exception('职业名称已存在!');
     }
     $param['profession_updatetime'] = time();
     return $db->update('t_profession', $param, 'profession_id = ?', array($param['profession_id']));
 }
开发者ID:Vincent-Shen,项目名称:origin,代码行数:23,代码来源:Profession.php

示例7: setCTFunc

 /**
  * 编辑授课教师AJAX方法
  * @param   array   $param  map<stirng,variant>类型的参数
  *                  int     ct_id   教师ID,若为0表新增
  *                  string  ct_name 名称
  *                  string  ctc_contact 联系方式
  *                  string  subject_id_str  形如1,3,4样式的学科ID列表
  *                  string  grade_id_str    形如1,3,4样式的年级ID列表
  *                  int     ct_flag     状态,-1已删,0禁用,1启用,大于1待审
  */
 public function setCTFunc($param)
 {
     $resp = new AjaxResponse();
     $param = Func::param_copy($param, 'ct_id', 'ct_name', 'ct_contact', 'subject_id_str', 'grade_id_str', 'ct_flag', 'cct_ccid_str', 'ct_memo');
     if (!Validate::isInt($param['ct_id']) || $param['ct_id'] < 0) {
         $reps->alert('教师ID不正确');
         return $resp;
     }
     if ($param['ct_name'] == '') {
         $resp->alert('教师名称不正确');
         return $resp;
     }
     if ($param['ct_contact'] == '') {
         $param['ct_contact'] = NULL;
     }
     if (!Validate::isJoinedIntStr($param['grade_id_str'])) {
         $resp->alert('所选年级不正确');
         return $resp;
     }
     if (!Validate::isJoinedIntStr($param['subject_id_str'])) {
         $resp->alert('所选学科不正确');
         return $resp;
     }
     if ($param['cct_ccid_str'] == '') {
         $param['cct_ccid_list'] = array();
     } else {
         if (!Validate::isJoinedIntStr($param['cct_ccid_str'])) {
             $resp->alert('所选课程不正确');
             return $resp;
         } else {
             $param['cct_ccid_list'] = explode(',', $param['cct_ccid_str']);
         }
     }
     $param['subjectid_list'] = array_unique(explode(',', $param['subject_id_str']));
     $param['gradeid_list'] = array_unique(explode(',', $param['grade_id_str']));
     if (count($param['gradeid_list']) == count(C('grades'))) {
         $param['gradeid_list'] = array(0);
     }
     try {
         if ($param['ct_id']) {
             CTeacherModel::setCTeacher($param);
             admin_log('edit', 'cteacher', "ct_id: " . $param['ct_id']);
         } else {
             $param['ct_id'] = CTeacherModel::addCTeacher($param);
             admin_log('add', 'cteacher', "ct_id: " . $param['ct_id']);
         }
         $resp->redirect('/admin/cteacher/ctinfo/' . $param['ct_id']);
     } catch (Exception $e) {
         $resp->alert($e->getMessage());
     }
     return $resp;
 }
开发者ID:Vincent-Shen,项目名称:origin,代码行数:62,代码来源:cteacher.php

示例8: saveexamrelatequestion

 public function saveexamrelatequestion()
 {
     $param = Func::param_copy($_POST, 'erq_examid', 'erq_paperid', 'erq_zmoss_examid', 'erq_relate_data');
     if (!Validate::isInt($param['erq_examid']) || $param['erq_examid'] <= 0 || !Validate::isInt($param['erq_zmoss_examid']) || $param['erq_zmoss_examid'] <= 0) {
         message('请确认考试学科对应关系!');
     }
     if (!Validate::isInt($param['erq_paperid']) || $param['erq_paperid'] <= 0) {
         message('测评考试学科试卷不可为空!');
     }
     $erq_relate_data = $param['erq_relate_data'];
     if ($erq_relate_data != array_filter($param['erq_relate_data']) || count($erq_relate_data) != count(array_unique($erq_relate_data))) {
         message('试题对应关系只能是一对一且不可为空!');
     }
     $param['erq_relate_data'] = json_encode($param['erq_relate_data']);
     try {
         $message = "试题对应关系设置";
         if (ZmossModel::setExamRelateQuestion($param)) {
             admin_log('set', 'exam_relate_question', $param['erq_examid']);
             $message .= "成功!";
         } else {
             $message .= "失败!";
         }
     } catch (Exception $e) {
         $message = $e->getMessage();
     }
     message($message, '/admin/zmoss/setexamrelatequestion/' . $param['erq_examid'] . '/' . $param['erq_zmoss_examid'] . '/?er_paperid=' . $param['erq_paperid']);
 }
开发者ID:Vincent-Shen,项目名称:origin,代码行数:27,代码来源:zmoss.php

示例9: setSchoolTeacherFunc

 /**
  * 编辑授课教师AJAX方法
  * @param   array   $param  map<stirng,variant>类型的参数
  *                  int     scht_schid  学校id
  *                  int     ct_id   教师ID,若为0表新增
  *                  string  ct_name 名称
  *                  string  subject_id_str  形如1,3,4样式的学科ID列表
  *                  string  grade_id_str    形如1,3,4样式的年级ID列表
  *                  int     ct_flag     状态,-1已删,0禁用,1启用,大于1待审
  */
 public function setSchoolTeacherFunc($param)
 {
     $resp = new AjaxResponse();
     if (!$this->check_power_new('school_editteacher', false)) {
         $resp->alert('您没有权限执行该功能');
         return $resp;
     }
     $param = Func::param_copy($param, 'scht_schid', 'ct_id', 'ct_name', 'ct_contact', 'subject_id_str', 'grade_id_str', 'ct_flag', 'cct_ccid_str', 'ct_memo');
     if (!Validate::isInt($param['scht_schid']) || $param['scht_schid'] <= 0) {
         $resp->alert('教师所属学校不正确');
         return $resp;
     }
     if (!Validate::isInt($param['ct_id']) || $param['ct_id'] < 0) {
         $resp->alert('教师ID不正确');
         return $resp;
     }
     if ($param['ct_name'] == '') {
         $resp->alert('教师名称不正确');
         return $resp;
     }
     if (!Validate::isJoinedIntStr($param['grade_id_str'])) {
         $resp->alert('所选年级不正确');
         return $resp;
     }
     if (!Validate::isJoinedIntStr($param['subject_id_str'])) {
         $resp->alert('所选学科不正确');
         return $resp;
     }
     $param['subjectid_list'] = array_unique(explode(',', $param['subject_id_str']));
     $param['gradeid_list'] = array_unique(explode(',', $param['grade_id_str']));
     if (count($param['gradeid_list']) == count(C('grades'))) {
         $param['gradeid_list'] = array(0);
     }
     try {
         if ($param['ct_id']) {
             SchoolModel::setSchoolTeacher($param);
             admin_log('edit', 'school_teacher', "ct_id: " . $param['ct_id']);
         } else {
             $param['ct_id'] = SchoolModel::addSchoolTeacher($param);
             admin_log('add', 'school_teacher', "ct_id: " . $param['ct_id']);
         }
         $resp->redirect('/admin/school/teacherlist/' . $param['scht_schid']);
     } catch (Exception $e) {
         $resp->alert($e->getMessage());
     }
     return $resp;
 }
开发者ID:Vincent-Shen,项目名称:origin,代码行数:57,代码来源:school.php

示例10: studentAjaxLogin

    public static function studentAjaxLogin($param, $bPasswordEnc = false, $bValidateOnly = false)
    {
        $resp = new AjaxResponse();
        $param = Func::param_copy($param, 'ticket', 'password');
        if (empty($param['ticket']) || empty($param['password'])) {
            $resp->alert('帐号或密码不能为空!');
            return $resp;
        }
        $where = array();
        $bind = array();
        if (is_email($param['ticket'])) {
            $where[] = 'email = ?';
            $bind[] = $param['ticket'];
        } else {
            if (is_idcard($param['ticket'])) {
                $where[] = 'idcard = ?';
                $bind[] = $param['ticket'];
            } else {
                //message('请输入合法的登陆帐号');
                $where[] = 'exam_ticket = ? OR external_account = ?';
                $bind[] = $param['ticket'];
                $bind[] = $param['ticket'];
            }
        }
        $where[] = 'password = ?';
        if ($bPasswordEnc) {
            $bind[] = $param['password'];
        } else {
            $bind[] = my_md5($param['password']);
        }
        $sql_where = implode(') AND (', $where);
        $sql = <<<EOT
SELECT uid, email, first_name, last_name, idcard, exam_ticket, 
    CONCAT(last_name, first_name) AS fullname,
    external_account, maprule, grade_id, sex, birthday, picture, mobile,
    is_check, last_login, last_ip, email_validate, status, is_delete, addtime,
    account, account_status
FROM rd_student WHERE ({$sql_where})
EOT;
        $user = Fn::db()->fetchRow($sql, $bind);
        if ($user) {
            $uid = $user['uid'];
            if (trim($user['picture'])) {
                $user['avatar_url'] = __IMG_ROOT_URL__ . $user['picture'];
            } else {
                $user['avatar_url'] = __IMG_ROOT_URL__ . 'zeming/exam/head.gif';
            }
            $resp->exdata = $user;
            if (!$bValidateOnly) {
                $sess = Fn::sess();
                if ($sess->userdata('uid') == $uid) {
                    // 当前登录用户已经是请求登录用户,不需要再登录了
                    $resp->refresh();
                } else {
                    $data = array();
                    $data['last_login'] = time();
                    $data['last_ip'] = Func::get_client_ip();
                    Fn::db()->update('rd_student', $data, 'uid = ' . $uid);
                    $sess->set_userdata(array('uid' => $uid, 'uinfo' => $user));
                    $sql = "SELECT * FROM rd_student_ranking WHERE uid = {$uid}";
                    $score_ranks = Fn::db()->fetchRow($sql);
                    if (!$score_ranks && $user['grade_id'] == 6) {
                        // 在basic页面会自动判断是否填写完全学生成绩并进行提示跳转
                        $resp->redirect(site_url('student/profile/basic'));
                    } else {
                        $resp->refresh();
                    }
                }
            }
        } else {
            $resp->alert('帐号或密码不正确!');
        }
        return $resp;
    }
开发者ID:Vincent-Shen,项目名称:origin,代码行数:74,代码来源:Student.php

示例11: AND

    /** 可用产品考试考场学科试卷列表
         * 
    SELECT 
        p.p_id, p.p_name, p.exam_pid,  p.p_status, p.p_price, p.p_notice, 
        p.p_price_pushcourse, p.p_prefixinfo,
        pc.pc_id, pc.pc_name, pc.pc_memo,
        e.exam_id, e.exam_name, e.exam_isfree, e.grade_id, e.class_id, 
        e.introduce AS exam_intro, e.student_notice AS exam_notice, 
        e.status AS exam_status,
        ep.place_id, ep.place_name, ep.address AS place_address, ep.ip AS place_ip,
        ep.start_time AS place_start_time, ep.end_time AS place_end_time, 
        eps.subject_id, esp.id AS esp_id, esp.exam_id AS esp_exam_id, esp.paper_id,
        pt.pt_id, pt.pt_status,pt.pt_money, pt.pt_money_in, pt.pt_type, pt.pt_memo, 
        pt.pt_log, cp.cp_addtime
    FROM rd_product p
    LEFT JOIN rd_product_category pc ON p.pc_id = pc.pc_id
    LEFT JOIN rd_exam e ON p.exam_pid = e.exam_id
    LEFT JOIN rd_exam_place ep ON p.exam_pid = ep.exam_pid
    LEFT JOIN rd_exam_place_subject eps ON p.exam_pid = eps.exam_pid 
        AND ep.place_id = eps.place_id 
    LEFT JOIN rd_exam_subject_paper esp ON eps.exam_pid = esp.exam_pid 
        AND eps.exam_id = esp.exam_id AND eps.subject_id = esp.subject_id
    LEFT JOIN rd_exam_paper epaper ON esp.paper_id = epaper.paper_id 
        AND esp.exam_id = epaper.exam_id
    LEFT JOIN rd_production_transaction pt ON p.exam_pid = pt.exam_pid 
        AND ep.place_id = pt.place_id AND pt.uid = 87
    LEFT JOIN rd_exam_place_student epstu ON ep.place_id = epstu.place_id 
        AND epstu.uid = 87
    LEFT JOIN t_course_push cp ON p.exam_pid = cp.cp_exampid 
        AND ep.place_id = cp.cp_examplaceid AND cp.cp_stuuid = 87
    WHERE p.pc_id = 12  -- 分类
    -- AND p.p_status = 1  -- 产品状态
    -- AND e.status = 1 -- 考试状态
    -- AND ((e.exam_isfree = 0 AND ep.start_time > unix_timestamp() )  
            OR e.exam_isfree = 1) -- 考试时间限制
    AND eps.subject_id IS NOT NULL -- 考场已分配学科 
    AND eps.subject_id = 2 -- 学科
    AND e.grade_id = 5 -- 年级
    AND esp.id IS NOT NULL -- 学科试卷以分配存
    AND epaper.paper_id IS NOT NULL -- 试卷存在
    
    
         * @param   string  $field = NULL       表示查询字段
         * @param   array   $cond_param = NULL  表示查询字段及值
         * @param   int     $page = NULL        为NULL表示查询所有不分页
         * @param   int     $perpage = NULL     为NULL表示取默认值或系统配置值
         * @return  array   list<map<string, variant>>类型数据
         */
    public static function productExamPlaceSubjectPaperList($field = NULL, array $cond_param = NULL, $page = NULL, $perpage = NULL)
    {
        $where = array();
        $bind = array();
        $where[] = 'subject_id IS NOT NULL';
        $where[] = 'esp_id IS NOT NULL';
        $where[] = 'paper_id IS NOT NULL';
        $table = 'v_product_exam_place_subject_paper a';
        if ($cond_param) {
            $cond_param = Func::param_copy($cond_param, 'pc_id', 'p_status', 'exam_status', 'subject_id', 'grade_id', 'exam_isfree', 'place_available', 'stu_uid');
            if (isset($cond_param['pc_id']) && Validate::isInt($cond_param['pc_id'])) {
                $where[] = 'a.pc_id = ' . $cond_param['pc_id'];
            }
            if (isset($cond_param['p_status']) && Validate::isInt($cond_param['p_status'])) {
                $where[] = 'a.p_status = ' . $cond_param['p_status'];
            }
            if (isset($cond_param['exam_status']) && Validate::isInt($cond_param['exam_status'])) {
                $where[] = 'a.exam_status = ' . $cond_param['exam_status'];
            }
            if (isset($cond_param['place_available']) && Validate::isInt($cond_param['place_available']) && $cond_param['place_available']) {
                $time = time();
                if (isset($cond_param['exam_isfree']) && Validate::isInt($cond_param['exam_isfree'])) {
                    if ($cond_param['exam_isfree'] == 0) {
                        $where[] = <<<EOT
(a.exam_isfree = 0 AND a.place_start_time > {$time})
EOT;
                    } else {
                        if ($cond_param['exam_isfree'] == 1) {
                            $where[] = 'a.exam_isfree = 1';
                        } else {
                            $where[] = 'a.exam_isfree = ' . $cond_param['exam_isfree'];
                        }
                    }
                } else {
                    $where[] = <<<EOT
(a.exam_isfree = 0 AND a.place_start_time > {$time}) OR a.exam_isfree = 1
EOT;
                }
            } else {
                if (isset($cond_param['exam_isfree']) && Validate::isInt($cond_param['exam_isfree'])) {
                    $where[] = 'a.exam_isfree = ' . $cond_param['exam_isfree'];
                }
            }
            if (isset($cond_param['subject_id']) && Validate::isInt($cond_param['subject_id'])) {
                $where[] = 'a.subject_id = ' . $cond_param['subject_id'];
            }
            if (isset($cond_param['grade_id']) && Validate::isInt($cond_param['grade_id'])) {
                $where[] = 'a.grade_id = ' . $cond_param['grade_id'];
            }
            if (isset($cond_param['stu_uid']) && Validate::isInt($cond_param['stu_uid'])) {
                $a_arr = explode(',', 'p_id,p_name,exam_pid,p_status,' . 'p_price,p_notice,p_price_pushcourse,p_prefixinfo,' . 'pc_id,pc_name,pc_memo,exam_id,exam_name,exam_isfree,' . 'grade_id,class_id,exam_intro,exam_notice,exam_status,' . 'place_id,place_name,place_address,place_ip,' . 'place_start_time,place_end_time,subject_id,' . 'esp_id,esp_exam_id,esp_paper_id,paper_id,class_name');
                $b_arr = explode(',', 'epstu_uid,cp_addtime');
//.........这里部分代码省略.........
开发者ID:Vincent-Shen,项目名称:origin,代码行数:101,代码来源:Product.php

示例12: setSubjectDimension

 /**
  * 编辑四维学科
  * @param   array   map<string,variant>类型的学科思维信息参数 
  *          int     subd_subjectid      学科四维ID
  *          string  subd_value          学科四维赋值
  *          string  subd_professionid   学科关联职业
  * @return  boolean 若成功则返回TRUE,否则返回0
  **/
 public static function setSubjectDimension($param)
 {
     $param = Func::param_copy($param, 'subd_subjectid', 'subd_value', 'subd_professionid');
     if (!Validate::isInt($param['subd_subjectid']) || $param['subd_subjectid'] <= 0) {
         throw new Exception('请选择学科');
     }
     if (count($param['subd_value']) != 4 || max($param['subd_value']) > 7 || min($param['subd_value']) < -7) {
         throw new Exception('学科四维赋值不合法');
     }
     if (!$param['subd_professionid']) {
         throw new Exception('请选择关联职业');
     }
     $param['subd_value'] = implode(',', $param['subd_value']);
     $param['subd_professionid'] = json_encode($param['subd_professionid']);
     return Fn::db()->update('t_subject_dimension', $param, 'subd_subjectid = ?', array($param['subd_subjectid']));
 }
开发者ID:Vincent-Shen,项目名称:origin,代码行数:24,代码来源:Subject.php

示例13: setProfessionRelated

 /**
  * 编辑职业兴趣/职业能力倾向,成功返回非0,失败返回0
  * $param为array,则为map<string, variant>,参数如下:
  *          int     pr_id           职业兴趣/职业能力倾向id
  *          int     pr_subjectid    学科id
  *          int     pr_knowledgeid  知识点id
  *          string  pr_explain      说明
  *          string  pr_professionid 关联职业(JSON字符串)
  * @return  mixed
  */
 public static function setProfessionRelated($param)
 {
     $param = Func::param_copy($param, 'pr_id', 'pr_explain', 'pr_professionid');
     if (empty($param['pr_professionid'])) {
         throw new Exception('关联职业不能为空');
     }
     $db = Fn::db();
     $param['pr_professionid'] = json_encode($param['pr_professionid']);
     $param['pr_updatetime'] = time();
     return $db->update('t_profession_related', $param, 'pr_id = ?', array($param['pr_id']));
 }
开发者ID:Vincent-Shen,项目名称:origin,代码行数:21,代码来源:ProfessionRelated.php

示例14: coursePushList

 /** 课程推送列表
  * @param   string  $field = NULL       表示查询字段
  * @param   array   $cond_param = NULL  表示查询字段及值
  * @param   int     $page = NULL        为NULL表示查询所有不分页
  * @param   int     $perpage = NULL     为NULL表示取默认值或系统配置值
  * @return  array   list<map<string, variant>>类型数据
  */
 public static function coursePushList($field = NULL, array $cond_param = NULL, $page = NULL, $perpage = NULL)
 {
     $where = array();
     $bind = array();
     if ($cond_param) {
         if (isset($cond_param['order_by'])) {
             $order_by = $cond_param['order_by'];
         }
         $cond_param = Func::param_copy($cond_param, 'cp_exampid', 'cp_stuuid');
         /*
                     if (isset($cond_param['province']) 
            && is_numeric($cond_param['province'])
            && $cond_param['province'] > 0)
                     {
            $where[] = 'province = ' . $cond_param['province'];
                     }
                     if (isset($cond_param['city'])
            && is_numeric($cond_param['city'])
            && $cond_param['city'] > 0)
                     {
            $where[] = 'city = ' . $cond_param['city'];
                     }
                     if (isset($cond_param['area'])
            && is_numeric($cond_param['area'])
            && $cond_param['area'] > 0)
                     {
            $where[] = 'area = ' . $cond_param['area'];
                     }
                     if (isset($cond_param['grade_period'])
            && is_array($cond_param['grade_period']))
                     {
            foreach ($cond_param['grade_period'] as $period)
            {
                $period = intval($period);
                $where[] = "grade_period LIKE '%$period%'";
            }
                     }
                     if (isset($cond_param['keyword']))
                     {
            $where[] = 'school_name LIKE ?';
            $bind[] = '%' . $cond_param['keyword'] . '%';
                     }
         */
         if (isset($cond_param['cp_exampid']) && Validate::isInt($cond_param['cp_exampid'])) {
             $where[] = 'cp_exampid = ?';
             $bind[] = $cond_param['cp_exampid'];
         }
         if (isset($cond_param['cp_stuuid']) && Validate::isInt($cond_param['cp_stuuid'])) {
             $where[] = 'cp_stuuid = ?';
             $bind[] = $cond_param['cp_stuuid'];
         }
     } else {
         $order_by = NULL;
     }
     return Fn::db()->fetchList('v_course_push', $field, $where, $bind, $order_by, $page, $perpage);
 }
开发者ID:Vincent-Shen,项目名称:origin,代码行数:63,代码来源:Course.php

示例15: setExamPlace

 /**
  * 修改考场信息
  */
 public function setExamPlace($param)
 {
     $param = Func::param_copy($param, 'place_id', 'exam_pid', 'place_name', 'school_id', 'place_schclsid', 'address', 'ip', 'start_time', 'end_time', 'exam_time_custom');
     if ((!$param['place_id'] || !Validate::isInt($param['place_id'])) && (!$param['exam_pid'] || !Validate::isInt($param['exam_pid']))) {
         return false;
     }
     $where = '';
     $where_bind = array();
     if ($param['place_id']) {
         unset($param['exam_pid']);
         $where = "place_id = ?";
         $where_bind[] = $param['place_id'];
     } else {
         unset($param['place_id']);
         $where = "exam_pid = ?";
         $where_bind[] = $param['exam_pid'];
     }
     return Fn::db()->update('rd_exam_place', $param, $where, $where_bind);
 }
开发者ID:Vincent-Shen,项目名称:origin,代码行数:22,代码来源:ExamPlace.php


注:本文中的Func::param_copy方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。