<?php
|
|
|
|
class likeresume_controller extends company
|
{
|
|
function index_action()
|
{
|
|
$JobM = $this->MODEL("job");
|
$resumeM = $this->MODEL("resume");
|
|
if ($_GET['jobid']) {
|
|
$id = (int)$_GET['jobid'];
|
$job = $JobM->getInfo(array('id' => $id), array('com' => 'yes'));
|
$this->yunset('job', $job);
|
|
$msg = $JobM->getYqmsList(array('fid' => $this->uid,'isdel'=>9,'jobid' => $id, 'groupby' => 'uid'));
|
|
$rData['field'] = "`id`,`uid`,`city_classid`,`job_classid`,`report`,`minsalary`,`maxsalary`,`edu`,`sex`,`exp`";
|
$where['defaults'] = 1;
|
|
if ($msg && is_array($msg)) {
|
|
$uids = array();
|
foreach ($msg as $val) {
|
$uids[] = $val['uid'];
|
}
|
$where['uid'] = array('notin', pylode(',', $uids));
|
}
|
$where['PHPYUNBTWSTART_A'] = '';
|
$where['job_classid'][] = array('findin', $job['job_post']);
|
$where['job_classid'][] = array('findin', $job['job1'], 'or');
|
$where['job_classid'][] = array('findin', $job['job1_son'], 'or');
|
$where['PHPYUNBTWEND_A'] = '';
|
|
$where['PHPYUNBTWSTART_B'] = '';
|
$where['city_classid'][] = array('findin', $job['provinceid']);
|
$where['city_classid'][] = array('findin', $job['cityid'], 'or');
|
$where['city_classid'][] = array('findin', $job['three_cityid'], 'or');
|
$where['PHPYUNBTWEND_B'] = '';
|
|
$where['orderby'] = 'lastupdate,desc';
|
$where['limit'] = 15;
|
|
$resume = $resumeM->getList($where, $rData);
|
$resume = $resume['list'];
|
|
|
if (is_array($resume)) {
|
$uids = array();
|
foreach ($resume as $v) {
|
$uids[] = $v['uid'];
|
}
|
if ($uids) {
|
$user = $resumeM->getResumeList(array('uid' => array('in', pylode(',', $uids))), array('field' => '`uid`,`name`,`nametype`,`sex`,`marriage`,`def_job`'));
|
}
|
foreach ($resume as $k => $v) {
|
|
if (isset($user) && !empty($user)) {
|
foreach ($user as $val) {
|
if ($v['uid'] == $val['uid']) {
|
$resume[$k]['name'] = $val['name_n'];
|
}
|
}
|
}
|
if ($v['sex'] == '152') {
|
|
$resume[$k]['sex'] = '女';
|
} elseif ($v['sex'] == '153') {
|
|
$resume[$k]['sex'] = '男';
|
} else {
|
|
$resume[$k]['sex'] = $v['sex_n'];
|
}
|
|
$resume[$k]['jobname'] = $v['job_classname'];
|
$resume[$k]['cityname'] = $v['city_classname'];
|
|
$pre = 60;
|
|
if ($job['job_edu'] == $v['edu_n'] || $job['job_edu'] == '不限') {
|
$pre = $pre + 5;
|
}
|
if ($job['job_sex'] == $v['sex_n']) {
|
$pre = $pre + 5;
|
}
|
if (isset($user) && !empty($user)) {
|
foreach ($user as $val) {
|
if ($v['uid'] == $val['uid']) {
|
if ($job['job_marriage'] == $val['marriage_n'] || $job['job_marriage'] == "不限") {
|
$pre = $pre + 5;
|
}
|
}
|
}
|
}
|
if ($job['job_report'] == $v['report_n'] || $job['job_report'] == "不限") {
|
$pre = $pre + 5;
|
}
|
if ($job['job_exp'] == $v['exp_n'] || $job['job_exp'] == "不限") {
|
$pre = $pre + 5;
|
}
|
$resume[$k]['pre'] = $pre;
|
}
|
|
$sort = array(
|
'direction' => 'SORT_DESC',
|
'field' => 'lastupdate',
|
);
|
$arrSort = array();
|
foreach ($resume as $uniqid => $row) {
|
foreach ($row as $key => $value) {
|
|
$arrSort[$key][$uniqid] = $value;
|
}
|
}
|
if ($sort['direction']) {
|
array_multisort($arrSort[$sort['field']], constant($sort['direction']), $resume);
|
}
|
|
$this->yunset("resume", $resume);
|
}
|
}
|
|
$this->yqmsInfo();
|
$this->public_action();
|
$this->company_satic();
|
|
$this->com_tpl('likeresume');
|
}
|
}
|
|
?>
|