chengkun
2025-04-18 1bb985f32f2efe0f9dd69f3cf29a1c809b1cf96d
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
<?php
 
/*
 * $Author :PHPYUN开发团队
 *
 * 官网: http://www.phpyun.com
 *
 * 版权所有 2009-2021 宿迁鑫潮信息技术有限公司,并保留所有权利。
 *
 * 软件声明:未经授权前提下,不得用于商业运营、二次开发以及任何形式的再次发布。
 */
class comapply_controller extends job_controller
{
 
    /**
     * 职位详情
     * 2019-06-12
     */
    function index_action()
    {
        $id = intval($_GET['id']);
        if (empty($id)) {
            $this->ACT_msg($_SERVER['HTTP_REFERER'], '参数错误!');
        }
 
        $JobM       =   $this->MODEL('job');
        $ComM       =   $this->MODEL('company');
        $statisM    =   $this->MODEL('statis');
        $RatingM    =   $this->MODEL('rating');
        $userinfoM  =   $this->MODEL('userinfo');
        $CompanyaccountM  =   $this->MODEL('companyaccount');
 
        $jobField   =   array('com'=>'yes', 'link'=>1, 'uid'=>$this->uid, 'usertype'=>$this->usertype);
        $JobInfo    =   $JobM->getInfo(array('id' => $id), $jobField);
        $recjobnum  =   $JobM->getJobNum(array('state'=>1,'r_status'=>1,'status'=>0,'job1'=>$JobInfo['job1'],'id'=>array('<>',$JobInfo['id'])));
        $this->yunset('recjobnum',$recjobnum);
 
        $department    =    $CompanyaccountM ->getInfo(array('uid'=>$JobInfo['zuid']),array('field'=>'`uid`,`name`'));
        $this->yunset('department', $department['name']);
        $viplist    =   $statisM->getInfo($JobInfo['uid'], array('usertype' => 2,'field' => '`vip_etime`,`rating`'));
        $comrat     =   $RatingM->getInfo(array('id' => $viplist['rating']), array('pic' => '1'));
        $this->yunset('comrat', $comrat);
        if (isVip($viplist['vip_etime'])) {
 
            $eviplist   =   1; // 表示未过期
        } else {
 
            $eviplist   =   2; // 表示已过期
        }
        $this->yunset('eviplist', $eviplist);
        
        // 联系方式
        $this->yunset('link', $JobInfo['linkInfo']);
        
        if(empty($JobInfo)){
            $this->ACT_msg($this->config['sy_weburl'], '职位不存在!');
        }else{
            // 管理员查看
            $look = isset($_GET['look']) && $_GET['look'] == 'admin' && !empty($_SESSION['auid']) ? 'admin' : '';
            if ($look != 'admin') {
                // 职位状态判断
                if (empty($this->uid) || $this->uid != $JobInfo['uid']) {
                    
                    if ($JobInfo['r_status'] == 0 || $JobInfo['r_status'] == 3) {
                        $this->ACT_msg($this->config['sy_weburl'], '企业暂未通过审核!');
                    } elseif ($JobInfo['r_status'] == 2 || $JobInfo['r_status'] == 4) {
                        $this->ACT_msg($this->config['sy_weburl'], '企业已被锁定!');
                    }elseif ($JobInfo['state'] == 0) {
                        $this->ACT_msg($_SERVER['HTTP_REFERER'], '职位审核中!');
                    } elseif ($JobInfo['state'] == 3) {
                        $this->ACT_msg($_SERVER['HTTP_REFERER'], '该职位未通过审核!');
                    }
                }
            }
        }
 
 
        $member     =   $userinfoM->getInfo(array('uid' => $JobInfo['uid']), array('field' => '`login_date`'));
        $JobInfo['login_date']  =   $member['login_date'];
 
        if ($JobInfo['status'] == 1) {
            $this->yunset('stop', 1);
        }
 
 
        // 有管理员登录信息时,设置state为1
        if (!empty($_SESSION['auid'])) {
            $adminM =   $this->MODEL('admin');
            $row    =   $adminM->getAdminUser(array('uid' => array('=', $_SESSION['auid'])));
            if (!empty($row) && $_SESSION['ashell'] == md5($row['username'].$row['password'].$this->md)) {
                $JobInfo['state'] = 1;
            }
        }
 
        $CacheM     =   $this->MODEL('cache');
        $CacheList  =   $CacheM->GetCache(array('job', 'city', 'com'));
        $this->yunset($CacheList);
 
        /* 个人会员登录状态 */
        if ($this->uid && $this->usertype == 1) {
 
            $UJWhere['uid']     =   $this->uid;
            $UJWhere['job_id']  =   $id;
            $UJWhere['isdel']   =   9;
            $userIdJobNum       =   $JobM -> getSqJobNum($UJWhere);
            if ($userIdJobNum > 0) {
                $this->yunset('userIdJobNum', $userIdJobNum);
            }
 
            $FJWhere['uid']     =   $this->uid;
            $FJWhere['job_id']  =   $id;
            $FJWhere['type']    =   '1';
            $favJobNum          =   $JobM -> getFavJobNum($FJWhere);
            if ($favJobNum > 0) {
                $this->yunset('favJobNum', $favJobNum);
            }
 
            $this->yunset('usertype', '1');
 
            $ResumeM    =   $this->MODEL('resume');
            $resumenum  =   $ResumeM->getExpectNum(array('uid'=>$this->uid,'status'=>1,'state'=>1,'r_status'=>1));
            $this->yunset('resumenum', $resumenum);
        }
 
        // 查询求职咨询信息
        $msgM       =   $this->MODEL('msg');
        $msgList    =   $msgM->getList(array('jobid' => $id, 'job_uid' => $JobInfo['uid'], 'reply' => array('<>',''), 'orderby' => 'datetime,desc', 'limit' => 5));
        $this->yunset('msgList', $msgList['list']);
 
        // 获取该职位的面试信息
        $company_msg    =   $ComM->getCompanyMsgInfo(array('jobid' => $id,'status'=>1), array('field' => '`content`'));
        if (!empty($company_msg)) {
            $this->yunset('company_msg', $company_msg);
        }
 
        // 投递数量
        $allnum     =   $JobM->getSqJobNum(array('job_id' => $id,'isdel'=>9));
        $replynum   =   $JobM->getSqJobNum(array('job_id' => $id,'isdel'=>9,'is_browse' => array('>', 1)));
        if ($allnum == 0) {
            $JobInfo['pre'] = 100;
        } else {
            $JobInfo['pre'] = round(($replynum / $allnum) * 100);
        }
        $JobInfo['snum'] = $allnum;
 
        $this->yunset('Info', $JobInfo);
 
        // 获取悬赏数据
        if ($JobInfo['rewardpack'] == 1) {
            $packM  =   $this->MODEL('pack');
            $reward =   $packM->getRewardJobInfo($id);
            $reward['money']        =   floatval($reward['money']);
            $reward['sqmoney']      =   floatval($reward['sqmoney']);
            $reward['invitemoney']  =   floatval($reward['invitemoney']);
            $reward['offermoney']   =   floatval($reward['offermoney']);
            $needs    =    array();
            if($reward['exp'] == '1'){$needs[]        =    '工作经历';}
            if($reward['edu'] == '1'){$needs[]        =    '教育经历';}
            if($reward['project'] == '1'){$needs[]    =    '项目经历';}
            if($reward['skill'] == '1'){$needs[]    =    '技能证书';}
            if(!empty($needs)){
                $reward['needs']    =    @implode(',', $needs);
            }
            $this->yunset('reward', $reward);
        }
 
        // 判断当天推荐职位、简历数是否已满
        if ($this->uid && isset($this->config['sy_recommend_day_num']) && $this->config['sy_recommend_day_num'] > 0) {
 
            $recomM =   $this->MODEL('recommend');
            $num    =   $recomM->getRecommendNum(array('uid' => $this->uid));
 
            if ($num >= $this->config['sy_recommend_day_num']) {
                $this->yunset('sy_recommend_day_num', $this->config['sy_recommend_day_num']);
            }
        }
 
        // 两次推荐职位、简历的最小时间间隔
        $recommendInterval = isset($this->config['sy_recommend_interval']) ? $this->config['sy_recommend_interval'] : 0;
        $this->yunset('recommendInterval', $recommendInterval);
 
        //包含此职位且可预约的视频面试
        $spviewM        =   $this->MODEL('spview');
 
        $yytime         =   time()+($this->config['sy_spview_yytime']*3600);
        
        $spviewWhere    =   array(
 
            'starttime' =>  array('>',$yytime),
            'status'    =>  1,
            'jobid'     =>  array('findin',$id),
            'roomstatus'=>  0
        );
 
        $spview         =   $spviewM->getInfo($spviewWhere,array('field'=>'id'));
 
        $this->yunset('spid',$spview['id']);
 
        $WhbM       =   $this->MODEL('whb');
 
        $syJobHb    =   $WhbM->getWhbList(array('type' => 1, 'isopen' => 1));
        
        $this->yunset('hbNum', count($syJobHb));
        if(!empty($syJobHb)){
            $hbids = array();
            foreach ($syJobHb as $hk => $hv) {
                $hbids[] = $hv['id'];
            }
            $this->yunset('hbids', $hbids);
        }
        
 
        // 获取seo使用的数据
        $data['job_name']       =   $JobInfo['jobname']; // 职位名称
        $data['company_name']   =   $JobInfo['com_name']; // 公司名称
        $data['industry_class'] =   $JobInfo['hy_n']; // 所属行业
        $data['job_class']      =   $JobInfo['job_one'].','.$JobInfo['job_two'].','.$JobInfo['job_three']; // 职位名称
        $data['job_salary']     =   $JobInfo['job_salary']; // 职位薪资
        $data['job_desc']       =   $this->GET_content_desc($JobInfo['description']); // 描述
        $this->data =   $data;
        $this->seo('comapply');
        $this->yun_tpl(array('comapply'));
    }
 
    /**
     * 职位详情
     * 求职咨询
     * 2019-06-12
     */
    function msg_action()
    {
        if ($_POST['submit']) {
 
            $_POST              =   $this->post_trim($_POST);
            $_POST['uid']       =   $this->uid;
            $_POST['username']  =   $this->username;
            $_POST['usertype']  =   $this->usertype;
 
            $msgM   =   $this->MODEL('msg');
 
            $res    =   $msgM->addMsg($_POST);
 
            $this->ACT_layer_msg($res['msg'], $res['errorcode'], $_SERVER['HTTP_REFERER']);
        }
    }
 
    /**
     * 职位详情
     * 浏览数量
     * 2019-06-12
     */
    function GetHits_action()
    {
        $id = intval($_GET['id']);
        if (empty($id)) {
            echo 'document.write(0)';
            die();
        }
 
        $JobM   =   $this->MODEL('job');
 
        $JobM->addJobHits($id);
 
        $hits   =   $JobM->getInfo(array('id' => $id), array('field' => '`uid`, `jobhits`'));
        echo 'document.write('.$hits['jobhits'].')';
        die();
    }
 
    /**
     * 职位详情
     * 获取联系方式
     * 2019-06-12
     */
    function gettel_action()
    {
 
        $id         =   intval($_POST['id']);
        $JobM       =   $this->MODEL('job');
        $dataArr    =   array('id' => $id, 'uid' => $this->uid, 'usertype' => $this->usertype,'isgetprv'=>$this->config['sy_comprivacy_open']);
        $telRes     =   $JobM -> getCompanyJobTel($dataArr);
        
        if (($telRes['errorcode'] == 9 || $telRes['errorcode'] == 10) && ! empty($telRes['data'])) {
            $telRes['data']['errorcode'] = $telRes['errorcode'];
            $telRes['data']['msg']       = $telRes['msg'];
            echo json_encode($telRes['data']);
            die();
        } else {
            echo $telRes['errorcode'];
            die();
        }
    }
 
    
 
    /**
     * 求职竞争力分析
     */
    function compete_action()
    {
        if ($_POST['id']) {
 
            $competeM   =   $this->MODEL('compete');
 
            $List       =   $competeM->userJob($this->uid, (int)$_POST['id'], $this->usertype);
 
            if ($List['errcode'] != '1') {
 
                echo $List['errcode'];
            } else {
 
                $this->yunset('List', $List);
 
                $this->yun_tpl(array('usercompete'));
            }
        }
    }
 
    /**
     * 浏览历史记录
     */
    function history_action(){
 
        if ($_POST['id'] && $this->usertype == 1) {
 
            $id     =   intval($_POST['id']);
 
            $time   =   time();
 
            $cookieM        =   $this->MODEL('cookie');
            $cookieJobIds   =   $_COOKIE['lookjob'];
 
            if ($cookieJobIds) {
                $jobArr = @explode(',', $cookieJobIds);
                if (!in_array($id, $jobArr)) {
                    $lookJobIds =   $cookieJobIds.",".$id;
                }else{
                    $lookJobIds =   $cookieJobIds;
                }
            }else{
                $lookJobIds =   $id;
            }
 
            $cookieM -> setcookie('lookjob', $lookJobIds, time()+3600);
            // 增加职位浏览记录
            $JobM   =   $this->MODEL('job');
            $JobM -> addLookJob(array('uid' => $this->uid, 'jobid' => $id, 'datetime' => $time,'did' => $this->userdid));
        }
    }
    //微信扫码查看联系方式
    function telQrcode_action(){
        
        $WxM    =    $this -> MODEL('weixin');
        
        $qrcode =    $WxM->pubWxQrcode('jobtel',$_GET['id']);
        if(isset($qrcode)){
            
            $imgStr  =    CurlGet($qrcode);
            
            header("Content-Type:image/png");
            
            echo $imgStr;
        }
    }
    /**
     * 快速申请职位
     */
    function applyjobuid_action(){
        
        $CacheM     =   $this->MODEL('cache');
        $CacheList  =   $CacheM->GetCache(array('job', 'city', 'com', 'user', 'hy'));
        $this->yunset($CacheList);
        
        $this->yun_tpl(array('applyjobuid'));
    }
}
?>