當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。