From 8642932b71c25e340c9b76d4432de77f9caeed36 Mon Sep 17 00:00:00 2001 From: chengkun <chengkun@ishangstudy.com> Date: Tue, 20 May 2025 17:11:58 +0800 Subject: [PATCH] 提交 --- member/com/model/jobadd.class.php | 390 +++++++++++++++++++++++++++---------------------------- app/model/job.model.php | 5 2 files changed, 193 insertions(+), 202 deletions(-) diff --git a/app/model/job.model.php b/app/model/job.model.php index 5df8f76..8d5765a 100644 --- a/app/model/job.model.php +++ b/app/model/job.model.php @@ -1099,7 +1099,6 @@ $id = $data['id']; $uid = intval($data['uid']); - unset($post['com_id']); $spid = !empty($data['spid']) ? intval($data['spid']) : ''; @@ -1120,6 +1119,7 @@ $com = $this->select_once('company', array('uid' => $uid), '`uid`,`name`, `r_status`,`logo`,`provinceid`,`pr`,`mun`,`x`,`y`,`did`'); + if ($data['utype'] == 'admin') { //后台修改添加不需要审核 if ($post['r_status'] == 1) { @@ -1132,7 +1132,6 @@ // 查询企业认证是否认证成功 $companycert = $this->select_once('company_cert', array('uid' => $uid, 'type' => 3), '`uid`,`type`,`status`'); - // 在企业用户设置里企业发布职位审核未开启的情况下,未审核和未通过的企业,发布职位默认是未审核的。 if ($com['r_status'] != 1) { @@ -1228,7 +1227,7 @@ $this -> update_once('wxpub_twtask',array('jobname'=>$job_data['name'],'comname'=>$job_data['com_name']),array('jobid'=>$id)); $this -> update_once('fav_job',array('job_name'=>$job_data['name']),array('job_id'=>$id)); // 修改名企更新时间 - $this -> update_once('hot_job',array('lastupdate'=>time()),array('uid'=>$uid)); + $this -> update_once('hotjob',array('lastupdate'=>time()),array('uid'=>$uid)); } if ($data['utype'] != 'admin') { diff --git a/member/com/model/jobadd.class.php b/member/com/model/jobadd.class.php index 717625a..1dd6b02 100644 --- a/member/com/model/jobadd.class.php +++ b/member/com/model/jobadd.class.php @@ -1,55 +1,53 @@ <?php -class jobadd_controller extends company -{ - - function index_action() - { +class jobadd_controller extends company { + + function index_action() { - $company = $this -> comInfo['info']; - if(!$company['name'] || ! $company['provinceid'] || (!$company['linktel'] && ! $company['linkphone'])){ + $company = $this->comInfo['info']; + if (!$company['name'] || !$company['provinceid'] || (!$company['linktel'] && !$company['linkphone'])) { $this->ACT_msg('index.php?c=info', '请先完善基本资料!'); } $this->yunset('company', $company); // 身份认证信息,强制邮箱、手机、企业资质认证配置--start - $msg = array(); + $msg = array(); - $isallow_addjob = '1'; + $isallow_addjob = '1'; - $url = $this->spid ? 'index.php' : 'index.php?c=binding'; + $url = $this->spid ? 'index.php' : 'index.php?c=binding'; if ($this->config['com_enforce_emailcert'] == '1') { if ($company['email_status'] != '1') { - $isallow_addjob = '0'; - $msg[] = '邮箱认证'; + $isallow_addjob = '0'; + $msg[] = '邮箱认证'; } } if ($this->config['com_enforce_mobilecert'] == '1') { if ($company['moblie_status'] != '1') { - $isallow_addjob = '0'; - $msg[] = '手机认证'; + $isallow_addjob = '0'; + $msg[] = '手机认证'; } } - + if ($this->config['com_enforce_licensecert'] == '1') { - $comM = $this->MODEL('company'); - $cert = $comM -> getCertInfo(array('uid'=>$this->uid,'type'=>3), array('field' => '`uid`,`status`')); + $comM = $this->MODEL('company'); + $cert = $comM->getCertInfo(array('uid' => $this->uid, 'type' => 3), array('field' => '`uid`,`status`')); if ($company['yyzz_status'] != '1' && (empty($cert) || $cert['status'] == 2)) { - $isallow_addjob = '0'; - $msg[] = '企业资质认证'; + $isallow_addjob = '0'; + $msg[] = '企业资质认证'; } } if ($isallow_addjob == '0') { if ($this->spid) { - $this -> ACT_msg($url, '请联系主账号,先完成'.implode('、', $msg).'!'); - }else{ - $this -> ACT_msg($url, '请先完成'.implode('、', $msg).'!'); + $this->ACT_msg($url, '请联系主账号,先完成' . implode('、', $msg) . '!'); + } else { + $this->ACT_msg($url, '请先完成' . implode('、', $msg) . '!'); } } @@ -59,25 +57,25 @@ $this->ACT_msg('index.php?c=map', '请先完成地图设置!'); } } - + if ($this->config['com_gzgzh'] == '1') { - - $userinfoM = $this->MODEL('userinfo'); - $uInfo = $userinfoM->getInfo(array('uid' => $this->uid),array('field' => '`wxid`,`unionid`')); - if (empty($uInfo['wxid']) && empty($uInfo['unionid'])) { - $this->cookie->SetCookie('gzh','',(strtotime('today') - 86400)); + + $userinfoM = $this->MODEL('userinfo'); + $uInfo = $userinfoM->getInfo(array('uid' => $this->uid), array('field' => '`wxid`,`unionid`')); + if (empty($uInfo['wxid']) && empty($uInfo['unionid'])) { + $this->cookie->SetCookie('gzh', '', (strtotime('today') - 86400)); $this->ACT_msg('index.php', '请先关注公众号!'); - } + } } - - $statics = $this -> company_satic(); + + $statics = $this->company_satic(); if ($statics['addjobnum'] == 0) { // 会员过期 - if($this->spid){ + if ($this->spid) { $this->ACT_msg('index.php', '当前账号会员已到期,请联系主账号进行升级!', 8); - }else{ + } else { $this->ACT_msg('index.php?c=right', '你的会员已到期!', 8); } @@ -85,225 +83,220 @@ } if ($statics['addjobnum'] == 2) { // 会员套餐已用完 - + if ($this->config['integral_job'] != '0') { - if($this->spid){ + if ($this->spid) { $this->ACT_msg('index.php', '您的套餐数据已用完,请联系主账号进行分配!', 8); - }else{ + } else { $this->ACT_msg('index.php?c=right', '你的套餐已用完!', 8); } } else { - if($this->spid){ - $this->MODEL('statis')->upInfo(array('job_num' => '1'), array('uid' => $this->spid, 'usertype' => '2')); - }else{ - $this->MODEL('statis')->upInfo(array('job_num' => '1'), array('uid' => $this->uid, 'usertype' => '2')); - } + if ($this->spid) { + $this->MODEL('statis')->upInfo(array('job_num' => '1'), array('uid' => $this->spid, 'usertype' => '2')); + } else { + $this->MODEL('statis')->upInfo(array('job_num' => '1'), array('uid' => $this->uid, 'usertype' => '2')); + } } } - - $CacheArr = $this->MODEL('cache')->GetCache(array('hy', 'job', 'city', 'com', 'circle','user')); + + $CacheArr = $this->MODEL('cache')->GetCache(array('hy', 'job', 'city', 'com', 'circle', 'user')); $this->yunset($CacheArr); - if(empty($CacheArr['city_type'])){ - $this -> yunset('cionly',1); + if (empty($CacheArr['city_type'])) { + $this->yunset('cionly', 1); } - if(empty($CacheArr['job_type'])){ - $this -> yunset('jionly',1); + if (empty($CacheArr['job_type'])) { + $this->yunset('jionly', 1); } - $row = array(); - $row['hy'] = $company['hy']; - $row['sdate'] = time(); - $row['number'] = $CacheArr['comdata']['job_number'][0]; - $row['type'] = $CacheArr['comdata']['job_type'][0]; - $row['exp'] = $CacheArr['comdata']['job_exp'][0]; - $row['report'] = $CacheArr['comdata']['job_report'][0]; - $row['age'] = $CacheArr['comdata']['job_age'][0]; - $row['edu'] = $CacheArr['comdata']['job_edu'][0]; - $row['marriage']= $CacheArr['comdata']['job_marriage'][0]; + $row = array(); + $row['hy'] = $company['hy']; + $row['sdate'] = time(); + $row['number'] = $CacheArr['comdata']['job_number'][0]; + $row['type'] = $CacheArr['comdata']['job_type'][0]; + $row['exp'] = $CacheArr['comdata']['job_exp'][0]; + $row['report'] = $CacheArr['comdata']['job_report'][0]; + $row['age'] = $CacheArr['comdata']['job_age'][0]; + $row['edu'] = $CacheArr['comdata']['job_edu'][0]; + $row['marriage'] = $CacheArr['comdata']['job_marriage'][0]; $this->yunset('row', $row); - - $jobnum = $this->MODEL('job')->getJobNum(array('uid' => $this->uid)); + + $jobnum = $this->MODEL('job')->getJobNum(array('uid' => $this->uid)); $this->yunset('jobnum', $jobnum); - + $this->public_action(); $this->com_tpl('jobadd'); } - - function edit_action() - { - - $jobM = $this->MODEL('job'); - $statis = $this->company_satic(); + + function edit_action() { + + $jobM = $this->MODEL('job'); + $statis = $this->company_satic(); $this->yunset('statis', $statis); - + if ($_GET['id']) { - - $id = intval($_GET['id']); + + $id = intval($_GET['id']); } else { if ($_GET['jobcopy']) { - + // 如果没有套餐,则发布职位需要扣除积分,先判断是否有足够的积分 if ($statis['addjobnum'] == 2) { - + if (intval($statis['integral']) < intval($this->config['integral_job'])) { - - $this->ACT_msg($_SERVER['HTTP_REFERER'], '你的'. $this->config['integral_pricename'].'不够发布职位!', 8); + + $this->ACT_msg($_SERVER['HTTP_REFERER'], '你的' . $this->config['integral_pricename'] . '不够发布职位!', 8); } } } - $id = intval($_GET['jobcopy']); + $id = intval($_GET['jobcopy']); } - $row = $jobM->getInfo(array('id' => $id,'uid'=>$this->uid),array('add'=>'yes')); - + $row = $jobM->getInfo(array('id' => $id, 'uid' => $this->uid), array('add' => 'yes')); + if (empty($row)) { $this->ACT_msg('index.php?c=jobadd', '职位参数错误!'); } - - - $company = $this -> comInfo['info']; + $company = $this->comInfo['info']; if ($company['linktel'] == '' && $company['linkphone']) { $company['linktel'] = $company['linkphone']; } $this->yunset('company', $company); - $CacheArr = $this->MODEL('cache') -> GetCache(array('hy', 'job', 'city', 'com', 'user')); + $CacheArr = $this->MODEL('cache')->GetCache(array('hy', 'job', 'city', 'com', 'user')); $this->yunset($CacheArr); - if(empty($CacheArr['city_type'])){ - $this -> yunset('cionly',1); + if (empty($CacheArr['city_type'])) { + $this->yunset('cionly', 1); } - if(empty($CacheArr['job_type'])){ - $this -> yunset('jionly',1); + if (empty($CacheArr['job_type'])) { + $this->yunset('jionly', 1); } if ($row['autotime'] > time()) { - $row['autodate'] = date('Y-m-d', $row['autotime']); + $row['autodate'] = date('Y-m-d', $row['autotime']); } - $row['description'] = str_replace(array('ti<x>tle','“','”'), array('title',' ',' '), $row['description']); - $fuli = explode(',', $row['welfare']); + $row['description'] = str_replace(array('ti<x>tle', '“', '”'), array('title', ' ', ' '), $row['description']); + $fuli = explode(',', $row['welfare']); $row['arraywelfare'] = array_filter($fuli); $this->yunset('row', $row); - if ($row['is_link'] == 2){ + if ($row['is_link'] == 2) { $job_link = $jobM->getComJobLinkInfo(array('jobid' => $id, 'uid' => $this->uid)); $this->yunset('job_link', $job_link); } $this->public_action(); $this->com_tpl('jobadd'); } - - function save_action(){ - + + function save_action() { if ($_POST) { - $company = $this -> comInfo['info']; + $company = $this->comInfo['info']; - $rstaus = $company['r_status']; - + $rstaus = $company['r_status']; + $description = str_replace(array('&', 'background-color:#ffffff', 'background-color:#fff', 'white-space:nowrap;'), array('&', 'background-color:', 'background-color:', 'white-space:'), $_POST['description']); - + if ($_POST['job_post']) { - $cacheArr = $this->MODEL('cache')->GetCache('job'); - - if(empty($cacheArr['job_type'])){ - $_POST['job1'] = $_POST['job_post']; - $_POST['job1_son'] = ''; - $_POST['job_post'] = ''; - }else{ - $categoryM = $this->MODEL('category'); - - $row1 = $categoryM->getJobClass(array('id' => intval($_POST['job_post'])), '`keyid`'); - $row2 = $categoryM->getJobClass(array('id' => $row1['keyid']), '`keyid`'); - + $cacheArr = $this->MODEL('cache')->GetCache('job'); + + if (empty($cacheArr['job_type'])) { + $_POST['job1'] = $_POST['job_post']; + $_POST['job1_son'] = ''; + $_POST['job_post'] = ''; + } else { + $categoryM = $this->MODEL('category'); + + $row1 = $categoryM->getJobClass(array('id' => intval($_POST['job_post'])), '`keyid`'); + $row2 = $categoryM->getJobClass(array('id' => $row1['keyid']), '`keyid`'); + if ($row2['keyid'] == '0') { - $_POST['job1_son'] = $_POST['job_post']; - $_POST['job1'] = $row1['keyid']; - $_POST['job_post'] = ''; + $_POST['job1_son'] = $_POST['job_post']; + $_POST['job1'] = $row1['keyid']; + $_POST['job_post'] = ''; } else { - $_POST['job1_son'] = $row1['keyid']; - $_POST['job1'] = $row2['keyid']; + $_POST['job1_son'] = $row1['keyid']; + $_POST['job1'] = $row2['keyid']; } } } - - $post = array( - 'job1' => intval($_POST['job1']), - 'job1_son' => intval($_POST['job1_son']), - 'job_post' => intval($_POST['job_post']), - - 'provinceid' => intval($_POST['provinceid']), - 'cityid' => intval($_POST['cityid']), - 'three_cityid' => intval($_POST['three_cityid']), - - 'minsalary' => intval($_POST['salary_type']) == 1 ? 0 : intval($_POST['minsalary']), - 'maxsalary' => intval($_POST['salary_type']) == 1 ? 0 : intval($_POST['maxsalary']), - - 'description' => $description, - - 'is_link' => $_POST['islink'], - 'is_email' => $_POST['isemail'] ? $_POST['isemail'] : 1, - 'r_status' => $rstaus, - 'hy' => intval($_POST['hy']), - 'number' => intval($_POST['number']), - 'exp' => intval($_POST['exp']), - 'report' => intval($_POST['report']), - 'age' => intval($_POST['age']), - 'sex' => intval($_POST['sex']), - 'edu' => intval($_POST['edu']), - 'is_graduate' => intval($_POST['is_graduate']), - 'marriage' => intval($_POST['marriage']), - 'welfare' => @implode(',', $_POST['welfare']), - 'lang' => trim(pylode(',', $_POST['lang'])), - 'zuid' => $this->spid, - - 'exp_req' => trim($_POST['exp_req']), - 'edu_req' => trim($_POST['edu_req']), - - 'zp_num' => intval($_POST['zp_num']), - 'zp_minage' => intval($_POST['zp_minage']), - 'zp_maxage' => intval($_POST['zp_maxage']) - - - - ); - if($this->config['joblock']!=1 || empty($_POST['id'])){ - $post['name'] = $_POST['name']; - } - - $data = array( - 'post' => $post, - 'id' => intval($_POST['id']), - 'uid' => $this->uid, - 'spid' => $this->spid, - 'usertype' => $this->usertype, - 'did' => $this->userdid, - - 'link_man' => intval($_POST['islink']) == 2 ? $_POST['link_man'] : '', - 'link_moblie' => intval($_POST['islink']) == 2 ? $_POST['link_moblie'] : '', - 'email' => intval($_POST['islink']) == 2 ? $_POST['email'] : '', - 'link_address' => intval($_POST['islink']) == 2 ? $_POST['link_address'] : '', - 'x' => intval($_POST['islink']) == 2 ? $_POST['map_xval'] : '', - 'y' => intval($_POST['islink']) == 2 ? $_POST['map_yval'] : '', + $post = array( - 'tblink' => $_POST['tblink'], - 'jobcopy' => $_POST['jobcopy'] - ); - - $this->cookie->SetCookie('delay', '', time() - 60); - - $jobM = $this->MODEL('job'); + 'job1' => intval($_POST['job1']), + 'job1_son' => intval($_POST['job1_son']), + 'job_post' => intval($_POST['job_post']), + + 'provinceid' => intval($_POST['provinceid']), + 'cityid' => intval($_POST['cityid']), + 'three_cityid' => intval($_POST['three_cityid']), + + 'minsalary' => intval($_POST['salary_type']) == 1 ? 0 : intval($_POST['minsalary']), + 'maxsalary' => intval($_POST['salary_type']) == 1 ? 0 : intval($_POST['maxsalary']), + + 'description' => $description, + + 'is_link' => $_POST['islink'], + 'is_email' => $_POST['isemail'] ? $_POST['isemail'] : 1, + 'r_status' => $rstaus, + 'hy' => intval($_POST['hy']), + 'number' => intval($_POST['number']), + 'exp' => intval($_POST['exp']), + 'report' => intval($_POST['report']), + 'age' => intval($_POST['age']), + 'sex' => intval($_POST['sex']), + 'edu' => intval($_POST['edu']), + 'is_graduate' => intval($_POST['is_graduate']), + 'marriage' => intval($_POST['marriage']), + 'welfare' => @implode(',', $_POST['welfare']), + 'lang' => trim(pylode(',', $_POST['lang'])), + 'zuid' => $this->spid, + + 'exp_req' => trim($_POST['exp_req']), + 'edu_req' => trim($_POST['edu_req']), + + 'zp_num' => intval($_POST['zp_num']), + 'zp_minage' => intval($_POST['zp_minage']), + 'zp_maxage' => intval($_POST['zp_maxage']) - $return = $jobM->addJobInfo($data); - + + ); + if ($this->config['joblock'] != 1 || empty($_POST['id'])) { + $post['name'] = $_POST['name']; + } + + $data = array( + 'post' => $post, + 'id' => intval($_POST['id']), + 'uid' => $this->uid, + 'spid' => $this->spid, + 'usertype' => $this->usertype, + 'did' => $this->userdid, + + 'link_man' => intval($_POST['islink']) == 2 ? $_POST['link_man'] : '', + 'link_moblie' => intval($_POST['islink']) == 2 ? $_POST['link_moblie'] : '', + 'email' => intval($_POST['islink']) == 2 ? $_POST['email'] : '', + 'link_address' => intval($_POST['islink']) == 2 ? $_POST['link_address'] : '', + 'x' => intval($_POST['islink']) == 2 ? $_POST['map_xval'] : '', + 'y' => intval($_POST['islink']) == 2 ? $_POST['map_yval'] : '', + + 'tblink' => $_POST['tblink'], + 'jobcopy' => $_POST['jobcopy'] + ); + + $this->cookie->SetCookie('delay', '', time() - 60); + + $jobM = $this->MODEL('job'); + + $return = $jobM->addJobInfo($data); + if ($return['errcode'] == 9) { $this->ACT_layer_msg($return['msg'], $return['errcode'], $return['id']); @@ -316,13 +309,12 @@ } } } - - function getJobNum_action() - { + + function getJobNum_action() { if ($_POST['uid']) { - + $statis = $this->company_satic(); - + if ($statis) { echo $statis['addjobnum']; die(); @@ -331,30 +323,30 @@ } /** - * @desc 发布职位条件查询 + * @desc 发布职位条件查询 */ - function jobCheck_action() - { + function jobCheck_action() { - $jobM = $this->MODEL('job'); - $statisM= $this->MODEL('statis'); + $jobM = $this->MODEL('job'); + $statisM = $this->MODEL('statis'); - $uid = $this->uid; - $statis = $statisM -> getInfo($uid, array('usertype' => 2, 'field' => '`integral`')); + $uid = $this->uid; + $statis = $statisM->getInfo($uid, array('usertype' => 2, 'field' => '`integral`')); - $result = $jobM->getAddJobNeedInfo($uid, 1, $this->spid); - - $return = array( + $result = $jobM->getAddJobNeedInfo($uid, 1, $this->spid); + + $return = array( - 'msgList' => $result['pc'], - 'integral' => (int)$statis['integral'], - 'spid' => $this->spid + 'msgList' => $result['pc'], + 'integral' => (int)$statis['integral'], + 'spid' => $this->spid ); - + echo json_encode($return); die(); } } + ?> \ No newline at end of file -- Gitblit v1.9.0