public function SendJob()
 {
     $xfhy = array("A" => "互联网金融", "B" => "在线旅游", "C" => "教育", "D" => "健康医疗", "E" => "电子商务", "F" => "搜索", "G" => "传媒广告", "H" => "移动互联网", "I" => "O2O", "J" => "社交", "K" => "游戏", "L" => "云计算/大数据", "M" => "招聘", "N" => "智能家居", "O" => "智能电视", "P" => "企业服务", "Q" => "文化美术", "R" => "生活服务", "S" => "社会化营销", "T" => "运动体育", "U" => "安全", "V" => "硬件", "W" => "分类信息", "X" => "非TMT(非互联网)");
     $checkUserPavi = $this->checkUserPaviliong();
     if ($checkUserPavi === false) {
         $this->error("用户身份验证失败,请重新登陆后再试!");
         exit;
     }
     //如果传过来职位id,则做修改显示
     $jobid = $_GET['id'];
     if (!empty($jobid)) {
         $arJob = M("job")->where("id=" . $jobid)->find();
         if (!empty($arJob) && $arJob['checkinfo'] === 'false') {
             $arJob['strycatedata'] = M("casclist")->where("id = " . $arJob['strycate'])->getField("cascname");
             $arJob['Jobcatedata'] = M("casclist")->where("id = " . $arJob['Jobcate'])->getField("cascname");
             $arJob['jobplacedata'] = M("casclist")->where("id = " . $arJob['jobplace'])->getField("cascname");
             $this->assign("arJob", $arJob);
         }
     }
     $jobInfo = $this->getJobInfo();
     $this->assign("jobInfo", $jobInfo);
     //期望行业
     if (!empty($userinfo['strycate'])) {
         $stry = explode('+', $userinfo['strycate']);
         $strycate = '';
         foreach ($stry as $v) {
             $strycate .= getCscData($v) . '+';
         }
         $strycate = substr($strycate, 0, -1);
     } else {
         $strycate = "选择行业";
     }
     $userinfo['strycate_data'] = $strycate;
     //行业类别
     $sql = "SELECT * FROM `stj_casclist` WHERE parentid = 2  order by orderid ASC";
     $arStrycate = M("casclist")->query($sql);
     foreach ($arStrycate as &$cate) {
         $sql = "SELECT * FROM `stj_casclist` WHERE parentid = " . $cate['id'] . " order by orderid ASC";
         $cate['casclist'] = M("casclist")->query($sql);
     }
     $sql = "SELECT * FROM `stj_casclist` WHERE parentid =1  order by orderid ASC";
     $arJobcate = M("casclist")->query($sql);
     foreach ($arJobcate as &$jcate) {
         $sql = "SELECT * FROM `stj_casclist` WHERE parentid = " . $jcate['id'] . " order by orderid ASC";
         $jcate['casclist'] = M("casclist")->query($sql);
     }
     if (!empty($userinfo['area'])) {
         $areaTmp = explode('+', $userinfo['area']);
         $area = '';
         foreach ($areaTmp as $v) {
             $area .= getCscData($v) . '+';
         }
         $area = substr($area, 0, -1);
     } else {
         $area = "选择地区";
     }
     //地区
     $sql = "SELECT * FROM `stj_casclist` WHERE parentid =19  order by orderid ASC";
     $arArea = M("casclist")->query($sql);
     foreach ($arArea as &$areas) {
         $sql = "SELECT * FROM `stj_casclist` WHERE parentid = " . $areas['id'] . " order by orderid ASC";
         $areas['casclist'] = M("casclist")->query($sql);
     }
     //语言能力
     $sql = "select DISTINCT dataname,datavalue from stj_cascadedata where datagroup='joblang' and dataname !=''  group by dataname order by orderid";
     $ynData = M("cascadedata")->query($sql);
     $zwldId = M("casclist")->where("cascname='职位亮点'")->find();
     $ldData = M("casclist")->where("parentid='{$zwldId['id']}'")->select();
     ////////////////////////////////////////////////////正在招聘///////////////////////////////////////////////
     $today = strtotime(date("Y-m-d H:i:s"));
     $arCurrectList = $this->getCurrectJobList("and endtime > {$today}", 1);
     $checked = $checkUserPavi['checkinfo'];
     ////////////////////////////////////////////////////往期招聘///////////////////////////////////////////////
     $arOldList = $this->getCurrectJobList("and endtime < {$today}", 2);
     ///////////////////////////////////////////////////////////////////////////////////////////////////////////
     if (trim($_GET['act']) == "joblist") {
         $act = "CurrectJobList";
     } elseif (trim($_GET['act'] == "lastjoblist")) {
         $act = "OldJobList";
     } else {
         $act = "SendJob";
     }
     $this->assign("xfhy", $xfhy);
     $this->assign("arCurrectList", $arCurrectList);
     $this->assign("arOldList", $arOldList);
     $this->assign("act", $act);
     $this->assign("ischecked", $checked);
     $this->assign("arArea", $arArea);
     $this->assign("arJobcate", $arJobcate);
     $this->assign("arStrycate", $arStrycate);
     $this->assign("ynData", $ynData);
     $this->assign("ldData", $ldData);
     $this->assign("first_class", 3);
     $this->display("new_send_job");
 }
 function JobSearch()
 {
     $nowpage = I('i');
     //当前页码
     $title = I('position');
     //职位 1
     $industry = I("industry");
     //行业 2
     $place = I('area');
     //所在地区
     $treatment = I('treatment');
     //工资待遇
     $puttime = I('puttime');
     //发布时间
     if ($title) {
         //关键词模糊查询
         $keywordGroup = M("keyword_group")->where("keyword_group like '%" . $title . "%'")->getField("keyword_group");
         if ($keywordGroup) {
             $arKeywordGroup = explode(" ", $keywordGroup);
             $titleTmp = "";
             foreach ($arKeywordGroup as $keyword) {
                 if ($keyword) {
                     $titleTmp .= " or title like '%" . $keyword . "%' ";
                 }
             }
         }
         if (strlen($titleTmp) > 0) {
             $where .= " AND (title like '%" . $title . "%' " . $titleTmp . ") ";
         } else {
             $where .= " AND (title like '%" . $title . "%') ";
         }
     }
     $count = M("job")->where("employ>(select count(*) from stj_record where stj_record.j_id = stj_job.id and audstart=6) and checkinfo='true' and endtime>unix_timestamp(now()) and is_deleted=0 and is_show=1" . $where)->count();
     $page = new \Think\NewPage($count, 10);
     $arJobList = M("job")->where("employ>(select count(*) from stj_record where stj_record.j_id = stj_job.id and audstart=6) and  checkinfo='true' and endtime>unix_timestamp(now()) and is_deleted=0  and is_show=1" . $where)->order("orderid ASC,checktime DESC, starttime DESC")->limit($page->firstRow, $page->listRows)->select();
     $show = $page->show();
     foreach ($arJobList as $key => &$val) {
         //计算招聘费用,20%留作系统费用
         if ($val['Tariff'] > 10) {
             $val['Tariff'] = floor($val['Tariff'] * 0.8 / 100) * 100;
         } else {
             $val['Tariff'] = floor($val['treatment'] * $val['Tariff'] * 12 * 0.8 / 100) * 100;
         }
         //发布时间
         $val['starttime'] = $val['checktime'] != 0 ? date('Y-m-d H:i', $val['checktime']) : date('Y-m-d H:i', $val['starttime']);
         //职位名称
         if (!$val['title']) {
             $val['title'] = M("casclist")->where("id='{$val['Jobcate']}'")->getField("cascname");
         } else {
             $val['title'] = $val['title'];
         }
         //工资待遇
         $val['treatment'] = M("cascadedata")->where("datagroup='treatment' and datavalue='{$val['treatment']}'")->getField("dataname");
         //学历要求
         $val['education'] = M("cascadedata")->where("datagroup='education' and datavalue='{$val['education']}'")->getField("dataname");
         //公司信息
         $company = M("company")->where("id=" . $val['cpid'])->find();
         //公司名称
         $val['cpname'] = $company["cpname"];
         //公司缩略图
         $val['thumlogo'] = $company['thumlogo'] ? $company['thumlogo'] : "/Public/img/defoultLogo.png";
         //工作经验要求
         $val['experience'] = M("cascadedata")->where("datagroup='experience' and datavalue='{$val['experience']}'")->getField("dataname");
         $val['stage'] = M("cascadedata")->where("datagroup='stage' and datavalue=" . $company['stage'])->getField("dataname");
         $val['strycate'] = getCscData($val['strycate']);
         $val['nature'] = getDataName("nature", $company['nature']);
         $val['scale'] = getDataName("scale", $company['scale']);
         $val['record_num'] = M("record")->where("j_id=" . $val['id'])->count();
         //工作地点
         $val['jobplace'] = M("casclist")->where("id='{$val['jobplace']}'")->getField("cascname");
     }
     //工作地点下拉框
     $workarea = M('casclist')->where("parentid = 19")->order("orderid ASC")->select();
     //工资待遇
     $money = M('cascadedata')->where("datagroup='treatment' AND level=0 ")->select();
     //发布时间
     $positime = M('cascadedata')->where("datagroup='puttime'  AND level=0")->select();
     //行业类别
     $arIndustry = M('casclist')->where("parentid =2")->order("orderid ASC")->select();
     //职位类别
     $arPosition = M('casclist')->where("parentid =1")->order("orderid ASC")->select();
     //判断是否可以收藏职位搜索器
     $isSearchCollect = $_SESSION['username'] ? true : false;
     $act = trim($_GET['act']);
     if ($act == "collect") {
         //收藏职位
         $username = $_SESSION['username'];
         $count = M("job_collection")->where("username='******' and status =1")->count();
         $page = new \Think\NewPage($count, 10);
         $arCollectList = M("job_collection")->where("username='******' and status =1")->order("id desc")->limit($page->firstRow, $page->listRows)->select();
         $show = $page->show();
         $i = (($_GET['p'] ? $_GET['p'] : 1) - 1) * 15 + 1;
         foreach ($arCollectList as &$arCollectInfo) {
             $arCollectInfo['cpname'] = M("company")->where("id='{$arCollectInfo['cpid']}'")->getField("cpname");
             $arCollectInfo['count'] = M("record")->where("j_id=" . $arCollectInfo['j_id'] . "")->count();
             $arCollectInfo['endtime'] = date("Y-m-d", $arCollectInfo['endtime']);
             $arCollectInfo['sort_id'] = $i++;
         }
         $this->arCollectList = $arCollectList;
         $this->assign("page", $show);
     } else {
         $act = "";
     }
     $this->money = $money;
     $this->workarea = $workarea;
     $this->positime = $positime;
     $this->page = $show;
     $this->assign("act", $act);
     $this->assign("arJobList", $arJobList);
     $this->assign("isSearchCollect", $isSearchCollect);
     $this->assign("arIndustry", $arIndustry);
     $this->assign("arPosition", $arPosition);
     $this->assign("title", $title);
     $this->assign("first_class", 3);
     $this->assign("second_class", 8);
     $this->display("new_jobsearch");
 }