public function get_hot_job($id)
 {
     $sql = "select * from stj_job where stj_job.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 cpid={$id} order by orderid ASC,checktime DESC, starttime DESC";
     $return_data = $this->table('stj_job job')->query($sql);
     //得到岗位名称信息
     foreach ($return_data as $k => $v) {
         $com_sql = "select com.cpname,com.id cpid from stj_company com where  com.id=" . $v['cpid'];
         //关联公司信息
         $cas_sql = "select cas.cascname from stj_casclist cas where cas.id=" . $v['jobplace'];
         //关联casclist
         $return_data_com = $this->table('stj_company com')->query($com_sql);
         //echo"<pre>";var_dump($return_data_com);echo"</pre>";
         $return_data_cas = $this->table('stj_casclist cas')->query($cas_sql);
         //echo"<pre>";var_dump($return_data_cas);echo"</pre>";
         foreach ($return_data_com[0] as $k1 => $v1) {
             $return_data[$k][$k1] = $v1;
         }
         foreach ($return_data_cas[0] as $k1 => $v1) {
             $return_data[$k][$k1] = $v1;
         }
         //发布时间
         $return_data[$k]['starttime'] = $return_data[$k]['checktime'] != 0 ? date('Y-m-d', $return_data[$k]['checktime']) : date('Y-m-d', $return_data[$k]['starttime']);
         //得到 职位名称 数据
         if (empty($return_data[$k]['title'])) {
             $return_data[$k]['title'] = getCascList($return_data[$k]['Jobcate'], "信息不明");
         }
         //招聘资费处理
         if ($return_data[$k]['Tariff'] > 10) {
             $return_data[$k]['Tariff'] = floor($return_data[$k]['Tariff'] * 0.8 / 100) * 100;
         } else {
             $return_data[$k]['Tariff'] = floor($return_data[$k]['treatment'] * $return_data[$k]['Tariff'] * 12 * 0.8 / 100) * 100;
         }
         //得到 薪资待遇 数据
         $treatmentdata = getCascData('treatment', $return_data[$k]['treatment'], "信息不明");
         $arTreatmentdata = explode("-", str_replace("元", "", $treatmentdata));
         if (count($arTreatmentdata) == 1) {
             $return_data[$k]['treatmentdata'] = "80K以上";
         } else {
             $return_data[$k]['treatmentdata'] = $arTreatmentdata[0] / 1000 . "K-" . $arTreatmentdata[1] / 1000 . "K";
         }
         //$return_data[$k]['treatmentdata'] = ($arTreatmentdata[0] / 1000) . "K-" . ($arTreatmentdata[1] / 1000) . "K";
         //得到 工作经验 数据
         $experiencedata = getCascData('experience', $return_data[$k]['experience'], "信息不明");
         $return_data[$k]['experiencedata'] = $experiencedata;
         //得到 学历要求 数据
         $educationdata = getCascData('education', $return_data[$k]['education'], "无要求");
         $return_data[$k]['educationdata'] = $educationdata;
         //得到推荐人数
         $recommended_sql = "select count(*) as num from stj_record where stj_record.j_id = {$v['id']}";
         $recommendedArr = $this->table('stj_record')->query($recommended_sql);
         $return_data[$k]['recommendednum'] = $recommendedArr[0]['num'];
         //echo "<pre>";var_dump($return_data);echo"</pre>";
     }
     return $return_data;
 }
Esempio n. 2
0
 public function getRecommendJob($type = 1, $limit, $uid)
 {
     if ($type == 1) {
         $sql = "select *,rec.id recordid from stj_job job join stj_record rec on job.id=rec.j_id  and job.employ>(select count(*) from stj_record  rec where rec.j_id = job.id and audstart=6) and checkinfo='true' and endtime>unix_timestamp(now()) and is_deleted=0 and rec.t_id={$uid} order by orderid asc, starttime desc limit {$limit}";
     } else {
         $sql = "select *,rec.id recordid from stj_job job join stj_record rec on job.id=rec.j_id  and rec.t_id={$uid} and checkinfo='true' and (job.employ<(select count(*) from stj_record  rec where rec.j_id = job.id and audstart=6)  or  is_deleted=1 or endtime < unix_timestamp(now())) order by orderid asc, starttime desc limit {$limit}";
         //echo $sql;
     }
     $return_data = $this->table('stj_job')->query($sql);
     foreach ($return_data as $k => $v) {
         //通过简历id bt_id 得到被推荐人姓名
         $resumeOb = M("resume");
         $resumeArr = $resumeOb->where("id=" . $return_data[$k]["bt_id"])->find();
         $return_data[$k]['username'] = $resumeArr['username'];
         //通过公司id cpid 得到公司名字
         $comOb = M("company");
         $comArr = $comOb->field('cpname')->where("id=" . $return_data[$k]["cpid"])->find();
         $return_data[$k]['cpname'] = $comArr['cpname'];
         //得到岗位名称信息
         if (empty($return_data[$k]['title'])) {
             $return_data[$k]['title'] = getCascList($return_data[$k]['Jobcate'], "信息不明");
         }
         //通过工作地点的信息
         $cascOb = M("casclist");
         $cascArr = $cascOb->field('cascname')->where("id=" . $return_data[$k]['jobplace'])->find();
         $return_data[$k]['cascname'] = $cascArr['cascname'];
         //得到 薪资待遇 数据
         $treatmentdata = getCascData('treatment', $return_data[$k]['treatment'], "信息不明");
         $arTreatmentdata = explode("-", str_replace("元", "", $treatmentdata));
         if (count($arTreatmentdata) == 1) {
             $return_data[$k]['treatmentdata'] = "80K以上";
         } else {
             $return_data[$k]['treatmentdata'] = $arTreatmentdata[0] / 1000 . "K-" . $arTreatmentdata[1] / 1000 . "K";
         }
         //$return_data[$k]['treatmentdata'] = ($arTreatmentdata[0] / 1000) . "K-" . ($arTreatmentdata[1] / 1000) . "K";
         //招聘资费处理
         if ($return_data[$k]['Tariff'] > 10) {
             $return_data[$k]['Tariff'] = floor($return_data[$k]['Tariff'] * 0.8 / 100) * 100;
         } else {
             $return_data[$k]['Tariff'] = floor($return_data[$k]['treatment'] * $return_data[$k]['Tariff'] * 12 * 0.8 / 100) * 100;
         }
         //得到 面试状态 信息
         $audstartdata = getCascData('audstart', $return_data[$k]['audstart'], "信息不明");
         $return_data[$k]['audstartdata'] = $audstartdata;
         //已推荐的人数
         $recommended_sql = "select count(*) as num from stj_record where stj_record.j_id = {$v['id']}";
         $recommendedArr = $this->table('stj_record')->query($recommended_sql);
         $return_data[$k]['recommendnum'] = $recommendedArr[0]['num'];
     }
     return $return_data;
 }
</ul>
<?php 
    }
}
?>

  
            <?php 
if (!empty($_GET['jobid'])) {
    $arJob = M("job")->where("id=" . $_GET['jobid'])->find();
    if (empty($arJob)) {
        header("location:/index.php?s=/Job/job_list");
        die;
    }
    if (empty($arJob['title'])) {
        $arJob['title'] = getCascList($arJob['Jobcate'], "信息不明");
    }
    $jobname = $arJob['title'];
}
if (!empty($_GET['jid'])) {
    $arResume = M("resume")->where("id=" . $_GET['jid'])->find();
    if (empty($arResume)) {
        header("location:/index.php?s=/Job/job_list");
        die;
    }
    $resumename = $arResume['username'];
}
?>

<ul class="rcmd-steps">
    <li class="fl-lef m1">
 public function record_save()
 {
     if (empty($_POST['j_id']) || !is_numeric($_POST['j_id']) || empty($_POST['bt_id']) || !is_numeric($_POST['bt_id']) || empty($_POST['audstartdate'])) {
         echo json_encode(array("code" => 500, "msg" => "参数异常"));
         die;
     }
     $userinfo = $_SESSION['userinfo'];
     if (empty($userinfo)) {
         setcookie("gourl", "index.php?s=/Job/job_detail_new/jobid/" . $_POST['j_id'], time() + 3600, "/");
         echo json_encode(array("code" => 400, "msg" => "未登录"));
         die;
     }
     $uid = $userinfo['userid'];
     $data['j_id'] = $_POST['j_id'];
     $data['t_id'] = $uid;
     $data['bt_id'] = $_POST['bt_id'];
     $data['posttime'] = time();
     $data['audstartdate'] = $_POST['audstartdate'];
     $arJob = M("job")->where("id=" . $data['j_id'])->find();
     $sJobTitle = $arJob['title'];
     if ($sJobTitle == '0') {
         $sJobTitle = getCascList($arJob['Jobcate'], "信息不明");
     }
     $data['j_title'] = $sJobTitle;
     $recordOb = M("record");
     $isRecord = $recordOb->where("j_id=" . $data['j_id'] . " and bt_id=" . $data['bt_id'])->find();
     if (!empty($isRecord)) {
         echo json_encode(array("code" => 500, "msg" => "该简历已经推荐给该职位"));
         die;
     }
     $re = $recordOb->add($data);
     if ($re) {
         /*                         * *************【推荐候选人】操作日志 begin******************************** */
         $username = $userinfo['username'];
         $arResume = M("resume")->where("id=" . $data['bt_id'])->find();
         $sRecommended = $arResume['username'];
         //候选人名称
         $arCompany = M("company")->where("id=" . $arJob['cpid'])->find();
         $sCompanyName = $arCompany['cpname'];
         //公司名称
         $arNoticeInfo = getTNoticeInfo(1, $sRecommended, $sCompanyName, $sJobTitle);
         $sLogtitle = $arNoticeInfo[0];
         $sLogContent = $arNoticeInfo[1];
         $arNotice = array("uid" => $uid, "username" => $username, "bt_id" => $data['bt_id'], "j_id" => $data['j_id'], "title" => $sLogtitle, "content" => $sLogContent, "created_at" => time(), "updated_at" => time());
         M("notice_log")->add($arNotice);
         /*                         * *************【推荐候选人】操作日志 end******************************** */
         echo json_encode(array("code" => "200", "msg" => "保存成功"));
         die;
     } else {
         echo json_encode(array("code" => "500", "msg" => "保存失败"));
         die;
     }
 }
 public function record_save()
 {
     $data['j_id'] = $_POST['j_id'];
     $userinfo = $_COOKIE['userinfo'];
     if (empty($userinfo)) {
         setcookie("gourl", "/Home/Webchat/new_job");
         echo json_encode(array("code" => 400, "msg" => "未登录"));
         die;
     } else {
         setcookie("gourl", "");
         $userinfoArr = unserialize($userinfo);
     }
     $uid = $userinfoArr['userid'];
     $data['t_id'] = $uid;
     $data['bt_id'] = $_POST['bt_id'];
     $data['posttime'] = time();
     $data['audstartdate'] = $_POST['audstartdate'];
     $recordOb = M("record");
     $re = $recordOb->add($data);
     if ($re) {
         /************************【推荐候选人】操作日志 begin***************/
         $username = $userinfoArr['username'];
         $arResume = M("resume")->where("id=" . $data['bt_id'])->find();
         $sRecommended = $arResume['username'];
         //候选人名称
         $arJob = M("job")->where("id=" . $data['j_id'])->find();
         $sJobTitle = $arJob['title'];
         //职位名称
         if ($sJobTitle == '0') {
             $sJobTitle = getCascList($arJob['Jobcate'], "信息不明");
         }
         $arCompany = M("company")->where("id=" . $arJob['cpid'])->find();
         $sCompanyName = $arCompany['cpname'];
         //公司名称
         $arNotice = getTNoticeInfo(1, $sRecommended, $sCompanyName, $sJobTitle);
         $sLogtitle = $arNotice[0];
         $sLogContent = $arNotice[1];
         $bt_id = $data['bt_id'];
         //简历id
         $job_id = $data['j_id'];
         //职位id
         addNoticeLog($uid, $username, $bt_id, $job_id, $sLogtitle, $sLogContent);
         /************************【推荐候选人】操作日志 end***************/
         echo json_encode(array("code" => "200", "msg" => "保存成功"));
         die;
     } else {
         echo json_encode(array("code" => "500", "msg" => "保存失败"));
         die;
     }
 }
 public function record_save()
 {
     if (empty($_POST['j_id']) || !is_numeric($_POST['j_id']) || empty($_POST['bt_id']) || !is_numeric($_POST['bt_id']) || empty($_POST['audstartdate'])) {
         echo json_encode(array("code" => 500, "msg" => "参数异常"));
         die;
     }
     $userinfo = $_COOKIE['userinfo'];
     if (empty($userinfo)) {
         setcookie("gourl", "/Home/Webchatnew/job_detail/jobid/" . $_POST['j_id'], time() + 3600, "/");
         echo json_encode(array("code" => 400, "msg" => "未登录"));
         die;
     }
     $userinfoArr = unserialize($userinfo);
     $uid = $userinfoArr['userid'];
     $data['j_id'] = $_POST['j_id'];
     $data['t_id'] = $uid;
     $data['bt_id'] = $_POST['bt_id'];
     $data['posttime'] = time();
     $data['audstartdate'] = $_POST['audstartdate'];
     $arJob = M("job")->where("id=" . $data['j_id'])->find();
     $cid = $arJob['cpid'];
     $sJobTitle = $arJob['title'];
     if ($sJobTitle == '0') {
         $sJobTitle = getCascList($arJob['Jobcate'], "信息不明");
     }
     $data['j_title'] = $sJobTitle;
     //查看与该候选人电话号码相同的候选人的简历id
     $arAllResume = M("resume")->query("select s.id,s.mobile bt_mobile  from stj_resume r join stj_resume s  on r.id={$data['bt_id']} and s.mobile=r.mobile ");
     foreach ($arAllResume as $v) {
         $where .= " bt_id=" . $v['id'] . " OR";
     }
     $where = "(" . rtrim($where, "OR") . ")";
     $recordOb = M("record");
     //                $isRecord = $recordOb->where("j_id=" . $data['j_id'] . " and {$where} and  (audstart=1 or audstart=3 or audstart=5 or audstart=6) and status !=1")->find();
     $isRecord = $recordOb->where("j_id=" . $data['j_id'] . " and {$where} ")->find();
     if (!empty($isRecord)) {
         echo json_encode(array("code" => 500, "msg" => "该简历已经推荐给该职位"));
         die;
     }
     //                $isThisCompany = M("record")->query("select *  from stj_record where " . $where . " and j_id in (select id from stj_job where cpid = $cid) and (audstart=1 or audstart=3 or audstart=5 or audstart=6) and status !=1");
     $isThisCompany = M("record")->query("select *  from stj_record where " . $where . " and j_id in (select id from stj_job where cpid = {$cid}) ");
     if (!empty($isThisCompany)) {
         echo json_encode(array("code" => 500, "msg" => "该简历已经推荐给该公司的其他职位"));
         die;
     }
     //                $isThreeCompany = M("record")->query("select *  from stj_record  r join stj_job b on  r.j_id = b.id  and " . $where . "  and (audstart=1 or audstart=3 or audstart=5 or audstart=6) and status !=1 group by  b.cpid;");
     $isThreeCompany = M("record")->query("select *  from stj_record  r join stj_job b on  r.j_id = b.id  and " . $where . "  group by  b.cpid;");
     if (count($isThreeCompany) >= 3) {
         echo json_encode(array("code" => 500, "msg" => "该简历最多只能推荐给3家企业"));
         die;
     }
     $re = $recordOb->add($data);
     if ($re) {
         /*                         * *************【推荐候选人】操作日志 begin******************************** */
         $username = $userinfoArr['username'];
         $arResume = M("resume")->where("id=" . $data['bt_id'])->find();
         $sRecommended = $arResume['username'];
         //候选人名称
         $arCompany = M("company")->where("id=" . $arJob['cpid'])->find();
         $sCompanyName = $arCompany['cpname'];
         //公司名称
         $arNoticeInfo = getTNoticeInfo(1, $sRecommended, $sCompanyName, $sJobTitle);
         $sLogtitle = $arNoticeInfo[0];
         $sLogContent = $arNoticeInfo[1];
         $arNotice = array("uid" => $uid, "username" => $username, "bt_id" => $data['bt_id'], "j_id" => $data['j_id'], "title" => $sLogtitle, "content" => $sLogContent, "created_at" => time(), "updated_at" => time());
         M("notice_log")->add($arNotice);
         /*                         * *************【推荐候选人】操作日志 end******************************** */
         echo json_encode(array("code" => "200", "msg" => "保存成功"));
         die;
     } else {
         echo json_encode(array("code" => "500", "msg" => "保存失败"));
         die;
     }
 }