public function commentPage() { $gid = intval($_REQUEST['jid']); $count = M("evaluate")->where("tag='record' and status=0 and checkinfo ='true' and j_id='{$gid}'")->count(); $page = new \Think\Snewpage($count, 1); $arCommentList = M("evaluate")->where("tag='record' and status=0 and checkinfo ='true' and j_id='{$gid}'")->order("created_at DESC")->limit($page->firstRow, $page->listRows)->select(); foreach ($arCommentList as &$commentInfo) { $commnetUser = M("member")->where("id=" . $commentInfo['uid'])->find(); if ($commnetUser['avatar']) { $commentInfo['avatar'] = '/' . $commnetUser[avatar]; } else { $commentInfo['avatar'] = '/Public/img/rcmd-img/icon11.png'; } $commentInfo['created_at'] = date("Y-m-d", $commentInfo['created_at']); $commentInfo['username'] = cut_str($commentInfo['username'], 3, 0) . '**' . cut_str($commentInfo['username'], 2, -2); } $show = $page->show(); $this->assign("commentCount", $count); $this->assign("arCommentList", $arCommentList); $this->assign("page", $show); $this->display("new_comment_page"); }
function searchs() { $nowpage = I('i'); //当前页码 $position = I('position'); //职位 1 $industry = I("industry"); //行业 2 $place = I('area'); //所在地区 $title = trim(I('title')); //职位名称 $treatment = I('treatment'); //工资待遇 $puttime = I('puttime'); //发布时间 $cpname = I('cpname'); //公司名称 if ($cpname) { $where .= " AND (cpname like '%" . $cpname . "%') "; } 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 . "%') "; } } //职位 if ($position != "") { $jt = M("casclist")->where("parentid='" . $position . "'")->select(); $industryid = array(); foreach ($jt as $j) { $industryid[] = $j['id']; } $industryid[] = $position; $sindustryid = implode(",", $industryid); if ($sindustryid) { $where .= " AND Jobcate in (" . $sindustryid . ")"; } else { $where .= " AND Jobcate in (1000000000)"; } } //行业类别 if ($industry != "") { $jt = M("casclist")->where("parentid='" . $industry . "'")->select(); $industryid = array(); foreach ($jt as $j) { $industryid[] = $j['id']; } $industryid[] = $industry; $sindustryid = implode(",", $industryid); if ($sindustryid) { $where .= " AND strycate in (" . $sindustryid . ")"; } else { $where .= " AND strycate in (1000000000)"; } } if ($place != "") { $jobCate_list = M("casclist")->where("parentid='{$place}'")->select(); $jobid = array(); foreach ($jobCate_list as $jobInfo) { $jobid[] = $jobInfo['id']; } if ($jobid) { $jobid = implode(",", $jobid); $where .= " AND jobplace in (" . $jobid . ")"; } else { $where .= " AND jobplace in (1000000000)"; } } if ($treatment != "") { $where .= " AND treatment = '" . $treatment . "'"; } if ($puttime != "") { if ($puttime == '604800') { //一周以内时间戳记 $lastWeek = time() - 24 * 60 * 60 * 7; $where .= " AND starttime>" . $lastWeek; } else { if ($puttime == '1209600') { //两周以内时间戳记 $lastWeek = time() - 24 * 60 * 60 * 14; $where .= " AND starttime>" . $lastWeek; } else { if ($puttime == '2592000') { //一月以内时间戳记 $lastWeek = time() - 24 * 60 * 60 * 30; $where .= " AND starttime>" . $lastWeek; } } } } $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\Snewpage($count, self::$_size); $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['strycate'] = getCscData($val['strycate']); $val['nature'] = getDataName("nature", $company['nature']); $val['scale'] = getDataName("scale", $company['scale']); $val['stage'] = M("cascadedata")->where("datagroup='stage' and datavalue=" . $company['stage'])->getField("dataname"); $val['record_num'] = M("record")->where("j_id=" . $val['id'])->count(); //工作地点 $val['jobplace'] = M("casclist")->where("id='{$val['jobplace']}'")->getField("cascname"); } $this->nowpage = $nowpage; $this->assign("page", $show); $this->assign("arJobList", $arJobList); $this->display('page'); }