Пример #1
0
 public function resumeInvite()
 {
     $pkid = enInt($_GET['id']);
     $post_id = enInt($_GET['pid']);
     $invite_bool = D('InterviewInvitation')->checkPostResume($post_id, $pkid);
     if (is_numeric($pkid) && is_numeric($post_id)) {
         // 2016-01-07 该简历学生是否投递过企业,否则屏蔽联系信息
         $int = M('resume as re')->join('inner join resume_post as rp on re.student_id=rp.student_id')->field('rp.pkid')->where(array('re.pkid' => $pkid, 'rp.enterprise_id' => session('account.enterprise_id')))->count();
         if ($int > 0) {
             $this->assign('inviteViewNone', TRUE);
         }
         $this->assign('inviteView', TRUE);
         $this->assign('info', array('r_id' => $_GET['id'], 'p_id' => $_GET['pid'], 'invite' => $invite_bool));
         // 2015-12-29
         $resume_type = M('resume')->field('resume_type')->find($pkid);
         $this->assign('titleHtml', resumePostType($resume_type['resume_type']));
         $this->assign('centerHtml', $this->centerPreview($pkid, $post_id));
         $this->display('resume_look_view_invite');
     } else {
         returnjson(array('msg' => 'student.resume.error'));
     }
 }
 protected function resumeListBox($where_type, $search_form, $order, $forward = false)
 {
     $enterprise = session('account');
     //获取列表数据
     $param = I('get.');
     $param['ct'] = I('get.ct') ? urldecode(I('get.ct')) : '';
     isset($_GET['pt']) && $_GET['pt'] ? $where['resume_post.post_id'] = intval($param['pt']) : '';
     //职位
     isset($_GET['dt']) && $_GET['dt'] ? $where['student.education'] = intval($param['dt']) : '';
     //学历
     isset($_GET['ct']) && $_GET['ct'] ? $where['student.living_city'] = cityNameToid($param['ct']) : '';
     //学生所在城市
     isset($_GET['gt']) && $_GET['gt'] ? $where['student.graduate_year'] = I('get.gt') : '';
     //学生所在城市
     /*---------更新搜索规则start------------*/
     isset($_GET['ps']) && $_GET['ps'] ? $start = I('get.ps') : '';
     //实习开始时间
     isset($_GET['pe']) && $_GET['pe'] ? $end = I('get.pe') : '';
     //实习结束时间
     if ($start && !$end) {
         $where['_string'] = "post_subscribe.period_start >= '{$start}' OR post_subscribe.period_start ='0000-00-00'";
     }
     if (!$start && $end) {
         $where['_string'] = "post_subscribe.period_start <= '{$end}'";
     }
     if ($start && $end) {
         $where['_string'] = "(post_subscribe.period_start between '{$start}' and '{$end}') OR post_subscribe.period_start='0000-00-00'";
     }
     /*----------更新搜索规则end-----------*/
     isset($_GET['major_wish']) ? $major = I('get.major_wish') : '';
     //多专业
     if (is_array($major) && count($major) > 0 && $major[0] != 0) {
         $where['student.major_type'] = array('in', $major);
         $major_string = join($major, ',');
     }
     if (is_string($major)) {
         $major_arr = explode(',', $major);
         $where['student.major_type'] = array('in', $major_arr);
         $major_string = $major;
     }
     $where['resume_post.status'] = $where_type;
     $where['resume_post.send_type'] = 1;
     $where['post_subscribe.info_type'] = 1;
     $where['resume_post.enterprise_id'] = session('account.enterprise_id');
     $resumePostTotal = $this->ResumePostModel->getResumePostCount($where);
     //列表总数量
     $page = isset($_GET['p']) ? intval(htmlspecialchars(strip_tags($_GET['p']))) : '';
     //获取url的分页参数
     $page = max(1, $page);
     $page = min($page, ceil($resumePostTotal / $this->page_number));
     // 获取合法的分页数
     $resumePostList = $this->ResumePostModel->getResumePostData($where, $page, $this->page_number, $order);
     if ($resumePostList) {
         foreach ($resumePostList as $k => $v) {
             /*用于计算转发次数by allen at 2015-12-03*/
             if ($forward == true) {
                 $resumePostList[$k]['forward_count'] = $this->ResumeForwardModel->where(array('resume_post_id' => $v['pkid']))->getField('count(pkid)');
             }
             /*用于计算转发次数*/
             $resumePostList[$k]['education_text'] = $v['education'] ? getDegreeTextSTU($v['education']) : '';
             $resumePostList[$k]['graduate_text'] = $v['graduate_year'] ? getGradeText($v['graduate_year']) . '毕业' : '';
             $resumePostList[$k]['city_text'] = $v['living_city'] ? regionIdToname($v['living_city']) : '';
             $resumePostList[$k]['type_text'] = $v['resume_type'] ? resumePostType($v['resume_type']) : '';
             //处理时间
             if ($v['status'] == 1 || $v['status'] == 2) {
                 $show_time = $v['create_time'];
             } else {
                 $show_time = $v['deal_time'];
             }
             if ($v['status'] == 3) {
                 $resumePostList[$k]['status_text'] = '允许面试';
             }
             if ($v['status'] == 4) {
                 $resumePostList[$k]['status_text'] = '不合适';
             }
             $resumePostList[$k]['time_text'] = $show_time ? time2Unit($show_time) : '';
             if ($v['period_start'] == $this->date_type && $v['period_finish'] == $this->date_type) {
                 $resumePostList[$k]['dateType'] = 1;
             } elseif ($v['period_start'] != $this->date_type && $v['period_finish'] == $this->date_type) {
                 $resumePostList[$k]['dateType'] = 2;
             } else {
                 $resumePostList[$k]['dateType'] = 3;
             }
         }
     }
     if ($major_string) {
         $param['major_wish'] = $major_string;
     } else {
         unset($param['major_wish']);
     }
     if (is_null($major_string)) {
         $majorLi = '';
     }
     if ($major_string || $major_wish[0] == 0 && isset($_GET['major_wish'])) {
         $majorLi = majorNameListLi($major_string);
     }
     $map = $param ? $param : array();
     $Page = new PageAdmin($resumePostTotal, $this->page_number, $map);
     $this->assign('show', !empty($resumePostList) ? 1 : 0);
     //判断下拉框是否需要显示
     $this->assign('search_form', $search_form);
     $this->assign('majorLi', $majorLi);
     $this->assign('param', $param);
     $this->assign('total', $resumePostTotal);
     $this->assign('resumePostList', $resumePostList);
     $this->assign('page', $Page->show());
     $this->assign('majorTypeList', $this->majorTypeList());
     $this->assign('postList', $this->postList());
     $this->assign('majorList', $this->majorTypeArr());
     $this->assign('degreList', getDegreeTextSTU());
     $this->assign('grade', getGradeText());
 }