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()); }
protected function getBaseInfo($account_id = '') { $base_info = $this->StudentModel->getBaseInfo($account_id); //简历基本信息 if ($base_info) { $base_info['gender_text'] = getGerderText($base_info['gender']); $base_info['current_grade_text'] = getGradeText($base_info['graduate_year'] ? $base_info['graduate_year'] : ''); $base_info['education_text'] = getDegreeTextSTU($base_info['education']); $base_info['politics_status_text'] = getPoliticsText($base_info['politics_status']); $nothing = ''; $base_info['major_type_text'] = getMajorTypeText($base_info['major_type'], $nothing); $base_info['detail_major'] = trim($base_info['detail_major']); $base_info['living_city'] = regionIdToname($base_info['living_city']); $base_info['gender'] = empty($base_info['gender']) ? 1 : $base_info['gender']; $this->assign('baseInfo', $base_info); $this->assign('headpic', $this->StudentModel->studentAvatar()); } }
public function read() { $page = I('get.page'); $ajax = I('get.ajax') == 'true' ? true : false; $count_arr = $this->RegionViewModel->resumeViewTotal(); $count = $count_arr['sum']; $pagebtn['view'] = $count_arr['view']; $page_sum = ceil($count / $this->page_number); $page = isset($_GET['page']) ? intval($page) : 1; $page = min($page, $page_sum); $page = max(0, $page); $read = $this->RegionViewModel->resumeView($page, $this->page_number); foreach ($read as $k => $v) { $read[$k]['city'] = regionIdToname($v['city_id'], $this->RegionsModel); $read[$k]['scale'] = getScaleText($v['scale_id'], $this->ScaleModel); $read[$k]['industry'] = getIndustryText($v['industry_id'], $this->IndustryModel); if ($v['view'] > 1) { $read[$k]['create_time'] = time2Unit($this->RegionViewModel->lastViewTime($v['enterprise_id'])); } $read[$k]['create_time'] = time2Unit($v['create_time']); } $pagebtn['btn'] = self::page(1, $page, $page_sum); $this->assign('read', $read); $this->assign('page', $pagebtn); $html = $this->fetch('Student:student_read_list'); if (!$ajax) { $this->assign('readHtml', $html); $this->display('Student:student_read'); exit; } else { returnjson(array('data' => $html)); } }