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


PHP Validate::isJoinedIntStr方法代码示例

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


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

示例1: remove

 public function remove($pr_id)
 {
     if (!$pr_id && ($pr_id = $this->input->get('pr_ids'))) {
         $pr_id = implode(',', $pr_id);
     }
     if (!Validate::isJoinedIntStr($pr_id)) {
         message('请选择需要删除的职业能力倾向');
     }
     if (ProfessionRelatedModel::removeProfessionRelated($pr_id)) {
         admin_log('delete', 'vocational_aptitude', $pr_id);
         message('删除成功', '/admin/vocational_aptitude/index');
     } else {
         message('删除失败', '/admin/vocational_aptitude/index');
     }
 }
开发者ID:Vincent-Shen,项目名称:origin,代码行数:15,代码来源:vocational_aptitude.php

示例2: remove

 public function remove($learnstyle_id)
 {
     if (!$learnstyle_id && ($learnstyle_id = $this->input->get('learnstyle_ids'))) {
         $learnstyle_id = implode(',', $learnstyle_id);
     }
     if (!Validate::isJoinedIntStr($learnstyle_id)) {
         message('请选择需要删除的内化过程');
     }
     if (LearnStyleModel::removeLearnStyle($learnstyle_id)) {
         admin_log('delete', 'learn_style', $learnstyle_id);
         message('删除成功', '/admin/learn_style/index');
     } else {
         message('删除失败', '/admin/learn_style/index');
     }
 }
开发者ID:Vincent-Shen,项目名称:origin,代码行数:15,代码来源:learn_style.php

示例3: remove

 public function remove($profession_id)
 {
     if (!$profession_id && ($profession_id = $this->input->get('profession_ids'))) {
         $profession_id = implode(',', $profession_id);
     }
     if (!Validate::isJoinedIntStr($profession_id)) {
         message('请选择需要删除的职业');
     }
     if (ProfessionModel::removeProfession($profession_id)) {
         admin_log('delete', 'profession', $profession_id);
         message('删除成功', '/admin/profession/index');
     } else {
         message('删除失败', '/admin/profession/index');
     }
 }
开发者ID:Vincent-Shen,项目名称:origin,代码行数:15,代码来源:profession.php

示例4: get_evaluate_template_list

 /**
  * 获取模板列表
  * @param   array   $param
  * @param   int     $page
  * @param   int     $perpage
  * @return  void
  */
 public static function get_evaluate_template_list($param = array(), $page = null, $perpage = null)
 {
     $sql = "SELECT * FROM rd_evaluate_template";
     $where = array();
     $bind = array();
     if ($param) {
         if (isset($param['template_type'])) {
             if (Validate::isInt($param['template_type'])) {
                 $where[] = "template_type = " . intval($param['template_type']);
             } else {
                 if (Validate::isJoinedIntStr($param['template_type'])) {
                     $where[] = "template_type IN ( " . $param['template_type'] . ")";
                 }
             }
         }
         if (!empty($param['template_name'])) {
             $where[] = "template_name LIKE ?";
             $bind[] = '%' . $param['template_name'] . '%';
         }
         if (!empty($param['template_subjectid'])) {
             $template_subjectid = $param['template_subjectid'];
             if (is_array($template_subjectid)) {
                 $template_subjectid = implode(',', $template_subjectid);
             }
             $where[] = "template_subjectid LIKE '%,{$template_subjectid},%'";
         }
     }
     if ($where) {
         $sql .= " WHERE " . implode(' AND ', $where);
     }
     $sql .= " ORDER BY template_id DESC";
     if ($page && $perpage) {
         $start = ($page - 1) * $perpage;
         $sql .= " LIMIT {$perpage} OFFSET {$start}";
     }
     return Fn::db()->fetchAll($sql, $bind);
 }
开发者ID:Vincent-Shen,项目名称:origin,代码行数:44,代码来源:EvaluateTemplate.php

示例5: CTeacherSubjectIDPairs

    /**
     * 获取教师关联学科 对象, 查v_cteacher_subjectid视图
     * @param   string  $ct_id_str    形如1,3,4样式的教师ID字符串
     * @return  array   map<int, map<int, map<string, varaint>>> 
     *                     $arr[cts_ctid][cts_subjectid] = *
     */
    public static function CTeacherSubjectIDPairs($ct_id_str)
    {
        if (!Validate::isJoinedIntStr($ct_id_str)) {
            throw new Exception('教师ID列表应为形如1,2,3样式的ID列表字符串');
        }
        $sql = <<<EOT
SELECT * FROM v_cteacher_subjectid WHERE cts_ctid IN ({$ct_id_str})
ORDER BY cts_ctid, cts_subjectid
EOT;
        $rows = Fn::db()->fetchAll($sql);
        $arr = array();
        foreach ($rows as $v) {
            if (!isset($arr[$v['cts_ctid']])) {
                $arr[$v['cts_ctid']] = array();
            }
            $arr[$v['cts_ctid']][$v['cts_subjectid']] = $v;
        }
        unset($rows);
        return $arr;
    }
开发者ID:Vincent-Shen,项目名称:origin,代码行数:26,代码来源:CTeacher.php

示例6: removeTrainingCampus

    /**
     * 删除培训校区,若tc_flag > -1则为假删,否则为真删(已使用过的不可真删)
     * @param   string      $tc_id_str  形似1,2,3样式的ID列表
     * @return  int     成功执行则返回非,否则返回0
     */
    public static function removeTrainingCampus($tc_id_str)
    {
        if (!Validate::isJoinedIntStr($tc_id_str)) {
            throw new Exception('培训校区ID列表格式不正确,' . '应为英文逗号分隔开的ID字符串');
        }
        $db = Fn::db();
        $sql = <<<EOT
SELECT tc_id FROM t_training_campus
WHERE tc_flag = -1 AND tc_id IN ({$tc_id_str})
EOT;
        $rm_tc_ids = $db->fetchCol($sql);
        // 需要真删的ID
        if (!empty($rm_tc_ids)) {
            $rm_tc_str = implode(',', $rm_tc_ids);
            $sql = <<<EOT
SELECT DISTINCT cc_tcid FROM t_course_campus WHERE cc_tcid IN ({$rm_tc_str})
EOT;
            $nrm_tc_ids = $db->fetchCol($sql);
            // 不可真删的ID
            $rm_tc_ids = array_diff($rm_tc_ids, $nrm_tc_ids);
        }
        $bOk = false;
        if ($db->beginTransaction()) {
            if (!empty($rm_tc_ids)) {
                $rm_tc_str = implode(',', $rm_tc_ids);
                // 可真删的ID
                $sql = <<<EOT
SELECT tc_id, tc_tiid FROM t_training_campus WHERE tc_id IN ({$rm_tc_str})
EOT;
                $rows = $db->fetchAll($sql);
                $db->delete('t_training_campus', "tc_id IN ({$rm_tc_str})");
                foreach ($rows as $row) {
                    $ti_id = $row['tc_tiid'];
                    $sql = <<<EOT
UPDATE t_training_institution SET ti_campusnum = ti_campusnum - 1 
WHERE ti_id = {$ti_id}
EOT;
                    $db->exec($sql);
                }
            }
            $db->update('t_training_campus', array('tc_flag' => -1), "tc_id IN ({$tc_id_str})");
            $bOk = $db->commit();
            if (!$bOk) {
                $db->rollBack();
            }
        }
        return $bOk ? 1 : 0;
    }
开发者ID:Vincent-Shen,项目名称:origin,代码行数:53,代码来源:TrainingInstitution.php

示例7: removeSchoolTeacher

    /**
     * 删除教师,若ct_flag > -1则为假删,否则为真删(已使用过的不可真删)
     * @param   string      $ct_id_str  形似1,2,3样式的ID列表
     * @return  int     成功执行则返回非0,否则返回0
     */
    public static function removeSchoolTeacher($ct_id_str)
    {
        if (!Validate::isJoinedIntStr($ct_id_str)) {
            throw new Exception('教师ID列表格式不正确,' . '应为英文逗号分隔开的ID字符串');
        }
        $db = Fn::db();
        $sql = <<<EOT
SELECT ct_id FROM t_cteacher
WHERE ct_flag = -1 AND ct_id IN ({$ct_id_str})
EOT;
        $rm_ct_ids = $db->fetchCol($sql);
        // 需要真删的ID
        if (!empty($rm_ct_ids)) {
        }
        $bOk = false;
        if ($db->beginTransaction()) {
            if (!empty($rm_ct_ids)) {
                $rm_ct_str = implode(',', $rm_ct_ids);
                // 可真删的ID
                $db->delete('t_cteacher_gradeid', "ctg_ctid IN ({$rm_ct_str})");
                $db->delete('t_cteacher_subjectid', "cts_ctid IN ({$rm_ct_str})");
                $db->delete('t_cteacher_school', "scht_ctid IN ({$rm_ct_str})");
                $db->delete('t_cteacher', "ct_id IN ({$rm_ct_str})");
            }
            $db->update('t_cteacher', array('ct_flag' => -1), "ct_id IN ({$ct_id_str})");
            $bOk = $db->commit();
            if (!$bOk) {
                $db->rollBack();
            }
        }
        return $bOk ? 1 : 0;
    }
开发者ID:Vincent-Shen,项目名称:origin,代码行数:37,代码来源:School.php

示例8: professionInfo

 /**
  * 获取$profession_id所指定的职业信息,返回结果集
  * @param   mixed   $profession_id
  * @param   array   map<string, variant>
  */
 public static function professionInfo($profession_id)
 {
     if (!$profession_id) {
         return array();
     }
     if (Validate::isInt($profession_id)) {
         $sql = "SELECT * FROM t_profession\n                    WHERE profession_id = ?";
         return Fn::db()->fetchRow($sql, array($profession_id));
     } else {
         if (Validate::isJoinedIntStr($profession_id)) {
             $sql = "SELECT * FROM t_profession\n                    WHERE profession_id IN ({$profession_id})";
             return Fn::db()->fetchAssoc($sql);
         } else {
             return array();
         }
     }
 }
开发者ID:Vincent-Shen,项目名称:origin,代码行数:22,代码来源:Profession.php

示例9: 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);
 }
开发者ID:Vincent-Shen,项目名称:origin,代码行数:37,代码来源:traininginstitution.php

示例10: removeSubjectDimension

 /**
  * 删除四维学科
  * @param   array   map<string,variant>类型的学科思维信息参数 
  *          int     subd_subjectid      学科四维ID
  * @return  boolean 若成功则返回TRUE,否则返回0
  **/
 public static function removeSubjectDimension($subd_subjectid)
 {
     if (Validate::isInt($subd_subjectid)) {
         return Fn::db()->delete('t_subject_dimension', "subd_subjectid = {$subd_subjectid}");
     } else {
         if (Validate::isJoinedIntStr($subd_subjectid)) {
             return Fn::db()->delete('t_subject_dimension', "subd_subjectid IN ({$subd_subjectid})");
         } else {
             return false;
         }
     }
 }
开发者ID:Vincent-Shen,项目名称:origin,代码行数:18,代码来源:Subject.php

示例11: removeProfessionRelated

 /**
  * 删除职业兴趣/职业能力倾向
  * @param   int     $pr_id_str
  * @return  bool    true|false
  */
 public static function removeProfessionRelated($pr_id_str)
 {
     if (!Validate::isJoinedIntStr($pr_id_str)) {
         return false;
     }
     $db = Fn::db();
     $sql = "DELETE FROM t_profession_related WHERE pr_flag = '-1' \n                AND pr_id IN ({$pr_id_str})";
     $db->exec($sql);
     $sql = "UPDATE t_profession_related SET pr_flag = '-1'\n                WHERE pr_id IN ({$pr_id_str})";
     $db->exec($sql);
     return true;
 }
开发者ID:Vincent-Shen,项目名称:origin,代码行数:17,代码来源:ProfessionRelated.php

示例12: courseCampusTeacherPairs

    /**
     * 获取课程校区关联老师 对象, 查v_course_campus_teacher视图
     * @param   string  $cc_id_str    形如1,3,4样式的课程ID字符串
     * @return  array   map<int, map<int, map<string, varaint>>> 
     *                     $arr[cct_ccid][cct_ctid] = *
     */
    public static function courseCampusTeacherPairs($cc_id_str)
    {
        if (!Validate::isJoinedIntStr($cc_id_str)) {
            throw new Exception('课程校区ID列表应为形如1,2,3样式的ID列表字符串');
        }
        $sql = <<<EOT
SELECT * FROM v_course_campus_teacher WHERE cct_ccid IN ({$cc_id_str})
ORDER BY cct_ccid,cct_ctid 
EOT;
        $rows = Fn::db()->fetchAll($sql);
        $arr = array();
        foreach ($rows as $v) {
            if (!isset($arr[$v['cct_ccid']])) {
                $arr[$v['cct_ccid']] = array();
            }
            $arr[$v['cct_ccid']][$v['cct_ctid']] = $v;
        }
        unset($rows);
        return $arr;
    }
开发者ID:Vincent-Shen,项目名称:origin,代码行数:26,代码来源:Course.php

示例13: get_knowledge_children_list

 /**
  * 按学科ID,父ID的二级知识点列表
  * @param   int       学科ID
  * @param   int       上级ID
  * @return  array
  */
 public static function get_knowledge_children_list($subject_id = 0, $pid = 0)
 {
     if (!$subject_id || !Validate::isInt($subject_id) && !Validate::isJoinedIntStr($subject_id)) {
         return false;
     }
     $sql = "SELECT * FROM rd_knowledge WHERE ";
     if (Validate::isInt($subject_id)) {
         $sql .= " subject_id = {$subject_id}";
     } else {
         if (Validate::isJoinedIntStr($subject_id)) {
             $sql .= " subject_id IN ({$subject_id})";
         }
     }
     if ($pid > 0) {
         $sql .= " AND pid = {$pid}";
     } else {
         $sql .= " AND pid > 0";
     }
     return Fn::db()->fetchAssoc($sql);
 }
开发者ID:Vincent-Shen,项目名称:origin,代码行数:26,代码来源:Knowledge.php

示例14: 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

示例15: place_in

    /**
     * 测试报名
     * @param int $exam     期次id
     * @param int $place    场次id, 多个ID用英文逗号分隔开
     * @param int $p_id     产品id
     * @return json 成功/失败
     */
    public function place_in()
    {
        $exam = intval($this->input->post('exam'));
        $place = $this->input->post('place');
        $uid = $this->session->userdata('uid');
        $p_id = intval($this->input->post('p_id'));
        $force = intval($this->input->post('force'));
        $b_pushcourse = intval($this->input->post('b_pushcourse'));
        if (!Validate::isJoinedIntStr($place)) {
            output_json(CODE_ERROR, '报名失败,考场不正确');
        }
        // 检查是否存在该学生
        $account = StudentModel::get_student($uid, 'account,account_status');
        if (!count($account['account'])) {
            output_json(CODE_ERROR, '报名失败,不存在该学生.');
        } else {
            if ($account['account_status']) {
                output_json(CODE_ERROR, '报名失败,学生帐号已被冻结');
            }
        }
        if (CommonModel::get_product_trans($p_id, $uid, $place, $exam)) {
            output_json(CODE_ERROR, '报名失败,已报名该产品');
        }
        $res = CommonModel::get_product_list($p_id);
        if (!$res) {
            output_json(CODE_ERROR, '报名失败,产品不存在');
        } else {
            $price = $b_pushcourse ? $res['p_price_pushcourse'] : $res['p_price'];
            $pc_id = $res['pc_id'];
        }
        $account = $account['account'];
        $account1 = $account - $price;
        if ($account1 < 0) {
            output_json(CODE_ERROR, '帐号余额不足');
        }
        $inserts = array();
        $error = array();
        $code = CODE_ERROR;
        $place_id_arr = array_unique(explode(',', $place));
        $place_id_arr2 = array();
        foreach ($place_id_arr as $place_id) {
            if ($place_id) {
                $query = $this->db->select('p.*,e.exam_name,e.exam_id,e.exam_pid,e.grade_id')->from('exam_place p')->join('exam e', 'p.exam_pid=e.exam_id')->where(array('p.place_id' => $place_id))->get();
                $place = $query->row_array();
            } else {
                continue;
            }
            if (empty($place)) {
                $error[] = "考场[{$place_id}]信息不存在";
                //output_json(CODE_ERROR, '考场信息不存在');
                continue;
            }
            $ids = $uid;
            // 控制考场只能在未开始考试操作
            $no_start = ExamPlaceModel::place_is_no_start($place_id);
            if (!$no_start) {
                $error[] = "考场[{$place_id}]正确考试或已结束,无法报名";
                continue;
                //output_json(CODE_ERROR, '该考场正在考试或已结束,无法做此操作');
            }
            // $ids = my_intval($ids);
            // $school_id = (int)$this -> input ->post('school_id');
            // 该考场所考到的学科
            $subject_ids = array();
            $query = $this->db->select('subject_id')->from('exam_place_subject')->where(array('place_id' => $place['place_id']))->get();
            $subjects = $query->result_array();
            $subject_ids = array();
            foreach ($subjects as $subject) {
                $subject_ids[] = $subject['subject_id'];
            }
            $subject_ids = count($subject_ids) ? implode(',', $subject_ids) : '""';
            $place['start_time'] = $place['start_time'] + 1;
            $place['end_time'] = $place['end_time'] - 1;
            if ($force == 0) {
                $sql = "SELECT count(u.uid) FROM rd_student u\n                WHERE  u.grade_id={$place['grade_id']} AND u.is_delete=0 AND u.uid ={$ids}";
                $query = Fn::db()->fetchOne($sql);
                if ($query == 0) {
                    $error[] = "考场[{$place_id}]您的年级不符合要求";
                    $code = -2;
                    continue;
                    //output_json('-2', '你的年级不符合要求');
                }
            }
            $not_exists_sql = <<<EOT
SELECT uid 
FROM rd_exam_place_student ps, rd_exam_place p, rd_exam e
WHERE e.exam_isfree = 0
    AND ps.place_id = p.place_id 
    AND p.place_index = {$place['place_index']} 
    AND ps.uid = u.uid 
    AND p.exam_pid = e.exam_id
    AND 
    (
//.........这里部分代码省略.........
开发者ID:Vincent-Shen,项目名称:origin,代码行数:101,代码来源:profile.php


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