chengkun
2025-05-22 1a8aea45ebb1582c9f65d9e8dcd520002f83ae12
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
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
<?php
 
 
class show_controller extends resume_controller {
    
    /**
     * @desc 简历详情
     * 2019-08-14
     */
    function index_action() {
        $JobM = $this->MODEL('job');
        $statisM = $this->MODEL('statis');
        $getUid = intval($_GET['uid']);
        $getType = intval($_GET['type']);
        $getId = intval($_GET['id']);
        
        // 企业登录时,获取企业的职位列表
        if ($this->usertype == 2) {
            
            $uid = $this->uid;
            
            $jobWhere = array('uid' => $uid, 'state' => 1, 'r_status' => 1, 'status' => 0);
            
            $jobList = $JobM->getList($jobWhere, array('link' => 'yes', 'field' => '`com_name`, `name`, `id`, `is_link`, `link_type`, `uid`'));
            
            $company_job = array();
            
            if (!empty($jobList['list'])) {
                $company_job = $jobList['list'];
            }
            
            $this->yunset('company_job', $company_job);
            
            //邀请模板
            $yqmbM = $this->MODEL('yqmb');
            $ymlist = $yqmbM->getList(array('uid' => $uid, 'status' => 1));
            $ymnum = $yqmbM->getNum(array('uid' => $uid));
            $ymcan = $ymnum < $this->config['com_yqmb_num'] ? true : false;
            
            $this->yunset('ymlist', $ymlist);
            $this->yunset('ymcan', $ymcan);
        }
        
        // 未登录情况下,记录浏览数量
        if (($this->uid == '' || $this->username == '') && $this->config['sy_resume_visitors'] > 0) {
            if ($_COOKIE['resumevisitors'] >= $this->config['sy_resume_visitors'] && $_GET['look'] != 'admin') {
                
                $this->ACT_msg(Url('login'), '游客用户,每天只能访问' . $this->config['sy_resume_visitors'] . '份简历,请登录后继续访问!');
            } else {
                
                if ($_COOKIE['resumevisitors'] == '') {
                    
                    $resumevisitors = 1;
                } else {
                    
                    $resumevisitors = $_COOKIE['resumevisitors'] + 1;
                }
                $this->cookie->SetCookie('resumevisitors', $resumevisitors, strtotime(date("Y-m-d", strtotime("+1 day"))));
            }
            
        }
        
        $resumeM = $this->MODEL('resume');
        
        // 如果传入的是uid, 则先获取eid
        if (!empty($getUid)) {
            
            if ($getType == 2) {
                
                $resumeArr = $resumeM->getResumeInfo(array('uid' => $getUid, 'height_status' => 2), array('field' => '`id`'));
                $id = $resumeArr['id'];
            } else {
                if ($this->uid == $getUid) {
                    
                    $rwhere = array('uid' => $getUid);
                    
                } else {
                    
                    $rwhere = array('uid' => $getUid, 'r_status' => 1);
                    
                }
                
                $def_job = $resumeM->getResumeInfo($rwhere, array('field' => '`def_job`'));
                
                if (empty($def_job)) {
                    
                    $this->ACT_msg($this->config['sy_weburl'], '没有找到该人才!');
                } else if ($def_job['def_job'] < 1) {
                    
                    $this->ACT_msg($this->config['sy_weburl'] . '/member', '还没有创建简历!');
                } else if ($def_job['def_job']) {
                    
                    $id = $def_job['def_job'];
                }
            }
            
        } else if (!empty($getId)) {
            
            $id = $getId;
        }
        
        $this->yunset("eid", $id);
        
        $resume_expect = $resumeM->getInfoByEid(array('eid' => $id, 'uid' => $this->uid, 'usertype' => $this->usertype, 'spid' => $this->spid));
        
        if (empty($resume_expect)) {
            
            $this->ACT_msg($this->config['sy_weburl'], '没有找到该人才!');
        }
        if ($this->config['com_search'] == 1 && !$this->uid) {
            $this->ACT_msg(Url('resume'), '请先登录');
        }
        if ($this->config['sy_user_visit_resume'] == 0 && $this->usertype == 1 && $this->uid != $resume_expect['uid']) {
            
            $this->ACT_msg(Url('resume'), '个人用户无权限查看简历!');
        }
        // 检查简历隐私状态设置
        $canShow = true;
        if ($resume_expect['status'] == 2) {
            // 简历关闭
            $canShow = false;
        } elseif ($resume_expect['status'] == 3) {
            // 简历状态是投递企业可见
            $canShow = false;
            if (isset($resume_expect['userid_job'])) {
                // 已向企业投递简历,简历可以展示
                $canShow = true;
            } elseif (in_array($this->usertype, array(2, 3))) {
                // 检查个人是否主动向企业、猎头发送了简历,主动发送的,简历可以展示(也算作一种主动投递简历)
                $barr = array(
                    'from'      => $resume_expect['uid'],
                    'fusertype' => 1,
                    'to'        => $this->uid,
                    'tusertype' => $this->usertype,
                    'msgtype'   => 'resume'
                );
                $chatM = $this->MODEL('chat');
                $log = $chatM->getChatLog($barr);
                if (!empty($log)) {
                    $canShow = true;
                }
            }
        }
        if (!$canShow) {
            $this->ACT_msg(Url('resume'), '简历已设置不对外开放!');
        }
        // 查询黑名单
        $blackM = $this->MODEL('black');
        $blackInfo = $blackM->getBlackInfo(array('p_uid' => $this->uid, 'c_uid' => $resume_expect['uid']));
        
        if (!empty($blackInfo)) {
            
            $this->ACT_msg($this->config['sy_weburl'] . '/member', '该用户已关闭简历!');
        }
        
        if ($resume_expect['uid'] != $this->uid) {
            if ($resume_expect['state'] == 0) {
                
                $this->ACT_msg($this->config['sy_weburl'] . '/member', '简历正在审核中!');
            } elseif ($resume_expect['r_status'] == 2) {
                
                $this->ACT_msg($this->config['sy_weburl'] . '/member', '简历暂被锁定,请稍后查看!');
            } elseif ($resume_expect['state'] == 3) {
                
                $this->ACT_msg($this->config['sy_weburl'] . '/member', '简历审核暂未通过!');
            }
        }
        // 查询当前企业用户,是不是采集用户
        $userinfoM = $this->MODEL('userinfo');
        $UserMember = $userinfoM->getInfo(array('uid' => $resume_expect['uid']), array('field' => '`source`, `email`, `claim`'));
        $this->yunset('UserMember', $UserMember);
        
        $time = strtotime("-14 day");
        $allnum = $JobM->getYqmsNum(array('uid' => $resume_expect['uid'], 'datetime' => array('>', $time)));
        $replynum = $JobM->getYqmsNum(array('uid' => $resume_expect['uid'], 'datetime' => array('>', $time), 'is_browse' => array('>', 2)));
        
        $pre = $allnum > 0 ? round(($replynum / $allnum) * 100) : 0;
        $this->yunset('pre', $pre);
        
        if ($this->usertype == 2) {
            
            $comid = $this->uid;
            $jobnum = $JobM->getJobNum(array('uid' => $comid));
            $this->yunset('jobnum', $jobnum);
            
            // 人才收藏库
            $talent_pool = $resumeM->getTalentNum(array('eid' => $id, 'cuid' => $this->uid));
            $this->yunset('talent_pool', $talent_pool);
        }
        
        // 查看联系方式:m_status = 1 直接查看 showcontactflag && downresumes
        if ($resume_expect['privacy_status'] == '1') {
            //已投递简历免费查看或已下载简历 但需绑定隐私号(所有情况,隐私号状态最优先)
            
            $resume_expect['link_topmsg'] = "<a class='yun_newedition_resume_ceil_tel_n' href='javascript:void(0)' onclick=\"for_link('$id','" . Url("ajax", array('c' => 'for_link')) . "')\"><span>查看联系方式</span></a>";
            $resume_expect['link_msg'] = "<a class='yun_newedition_resume_look' href='javascript:void(0)' onclick=\"for_link('$id','" . Url("ajax", array('c' => 'for_link')) . "')\"><span>查看联系方式</span></a>";
            $resume_expect['link_msg_right'] = "<input class='yun_resume_xz' onClick=\"for_link('$id','" . Url("ajax", array('c' => 'for_link')) . "');\" type='button' name='submit' value='下载 '>";
        } elseif ($resume_expect['m_status'] == 1) {
            // 直接查看
            
            $resume_expect['link_topmsg'] = "<a class='yun_newedition_resume_ceil_tel_n' href='javascript:void(0)' onclick=\"getLinkStyle()\"><span>查看联系方式</span></a>";
            $resume_expect['link_msg'] = "<a class='yun_newedition_resume_look' href='javascript:void(0)' onclick=\"getLinkStyle()\"><span>查看联系方式</span></a>";
            $resume_expect['link_msg_right'] = "<input class='yun_resume_xz' onClick=\"for_link('$id','" . Url("ajax", array('c' => 'for_link')) . "','" . Url("ajax", array('c' => 'resume_word', 'id' => $id)) . "');\" type='button' name='submit' value='下载 '>";
        } elseif (isset($resume_expect['showcontactflag']) && $resume_expect['showcontactflag']) {
            // 可下载,提示剩余下载量
            
            $resume_expect['link_topmsg'] = "<a href='javascript:void(0)' class='yun_newedition_resume_ceil_tel_n' onclick=\"isDownResume('$id',{$resume_expect['downresumes']},'" . Url("ajax", array('c' => 'for_link')) . "')\"><span>查看联系方式</span></a>";
            $resume_expect['link_msg'] = "<a href='javascript:void(0)' class='yun_newedition_resume_look' onclick=\"isDownResume('$id',{$resume_expect['downresumes']},'" . Url("ajax", array('c' => 'for_link')) . "')\"><span>查看联系方式</span></a>";
            $resume_expect['link_res'] = "<a href='javascript:void(0)' onclick=\"isDownResume('$id',{$resume_expect['downresumes']},'" . Url("ajax", array('c' => 'for_link')) . "')\">查看简历详细信息</a>";
            $resume_expect['link_msg_right'] = "<input class='yun_resume_xz' onClick=\"for_link('$id','" . Url("ajax", array('c' => 'for_link')) . "','" . Url("ajax", array('c' => 'resume_word', 'id' => $id)) . "');\" type='button' name='submit' value='下载 '>";
        } else {
            
            $resume_expect['link_topmsg'] = "<a class='yun_newedition_resume_ceil_tel_n' href='javascript:void(0)' onclick=\"for_link('$id','" . Url("ajax", array('c' => 'for_link')) . "')\"><span>查看联系方式</span></a>";
            $resume_expect['link_msg'] = "<a class='yun_newedition_resume_look' href='javascript:void(0)' onclick=\"for_link('$id','" . Url("ajax", array('c' => 'for_link')) . "')\"><span>查看联系方式</span></a>";
            $resume_expect['link_res'] = "<a href='javascript:void(0)' onclick=\"for_link('$id','" . Url("ajax", array('c' => 'for_link')) . "')\">查看简历详细信息</a>";
            $resume_expect['link_msg_right'] = "<input class='yun_resume_xz' onClick=\"for_link('$id','" . Url("ajax", array('c' => 'for_link')) . "','" . Url("ajax", array('c' => 'resume_word', 'id' => $id)) . "');\" type='button' name='submit' value='下载 '>";
        }
        
        $data['resume_username'] = $resume_expect['username_n'];   // 简历人姓名
        $data['resume_city'] = $resume_expect['cityname'];     // 城市
        $data['resume_job'] = $resume_expect['customjob'];    // 行业
        $this->data = $data;
        $this->seo('resume');
        $this->yunset('Info', $resume_expect);
        
        // 已邀请面试数量
        if (!empty($resume_expect) && !empty($this->uid)) {
            $usermsgnum = $JobM->getYqmsNum(array('fid' => $this->uid, 'uid' => $resume_expect['uid'], 'isdel' => 9));
            $this->yunset('usermsgnum', $usermsgnum);
        }
        
        $this->yunset(array('uid' => $this->uid, 'usertype' => $this->usertype));
        
        $cData['uid'] = $this->uid;
        $cData['usertype'] = $this->usertype;
        $cData['eid'] = $resume_expect['id'];
        $cData['ruid'] = $resume_expect['uid'];
        $resumeCkeck = $resumeM->openResumeCheck($cData);
        $this->yunset('resumeCkeck', $resumeCkeck);
        /* 模糊字段 */
        $this->yunset('tj', $resume_expect['tj']);
        
        $this->yunset(array('resumestyle' => $this->config['sy_weburl'] . '/app/template/resume'));
        
        $tmp = intval($_GET['tmp']);
        
        $statis = $statisM->getInfo($resume_expect['uid'], array('usertype' => 1, 'field' => '`tpl`,`paytpls`'));
        
        if ($statis['paytpls']) {
            
            $paytpls = @explode(',', $statis['paytpls']);
            $this->yunset('paytpls', $paytpls);
        }
        $tplM = $this->MODEL('tpl');
        
        if (!empty($tmp)) {
            
            $url = $tplM->getResumetpl(array('id' => $tmp));
            
            if ($this->uid != $resume_expect['uid'] && in_array($tmp, $paytpls) == false) {
                unset($tmp);
            }
        } else {
            
            $tmp = 1;
            $url = $tplM->getResumetpl(array('id' => $statis['tpl']));
        }
        
        if (in_array($this->usertype, array(2, 3))) {
            
            $category = intval($this->usertype) - 1;
            
            // 会员等级 增值包 套餐
            $ratingM = $this->MODEL('rating');
            $ratingList = $ratingM->getList(array('display' => 1, 'orderby' => array('type,asc', 'sort,desc')));
            
            $rating_1 = $rating_2 = $raV = array();
            if (!empty($ratingList)) {
                foreach ($ratingList as $ratingV) {
                    
                    $raV[$ratingV['id']] = $ratingV;
                    
                    if ($ratingV['category'] == $category && $ratingV['service_price'] > 0) {
                        if ($ratingV['type'] == 1) {
                            
                            $rating_1[] = $ratingV;
                        } elseif ($ratingV['type'] == 2) {
                            
                            $rating_2[] = $ratingV;
                        }
                    }
                }
            }
            $this->yunset('rating_1', $rating_1);
            $this->yunset('rating_2', $rating_2);
            
            $statis = $statisM->getInfo($this->uid, array('usertype' => $this->usertype));
            
            if (!empty($statis)) {
                
                $discount = isset($raV[$statis['rating']]) ? $raV[$statis['rating']] : array();
                $this->yunset('discount', $discount);
                $this->yunset('statis', $statis);
            }
            
            if ($this->usertype == 2) {
                
                $add = $ratingM->getComSerDetailList(array('orderby' => array('type,asc', 'sort,desc')), array('pack' => '1'));
            } else if ($this->usertype == 3) {
                
                $ltM = $this->MODEL('lietou');
                $add = $ltM->getLtservicedetailList(array('orderby' => array('type,asc', 'sort,desc')), array('pack' => '1'));
            }
            $this->yunset('add', $add);
            
            $couponM = $this->MODEL('coupon');
            $couponList = $couponM->getCouponList(array('uid' => $this->uid, 'status' => 1, 'validity' => array('>', time()), 'orderby' => array('coupon_amount,asc', 'coupon_scope,asc')));
            $this->yunset('couponList', $couponList);
            
            if (!isVip($statis['vip_etime'])) {
                
                $this->yunset('vipIsDown', 1); //  会员过期
            }
        }
        
        if ($url['url'] == '') {
            unset($tmp);
        }
        
        $this->moreMenu();
        
        $cacheM = $this->MODEL('cache');
        
        $options = array('user');
        
        $cache = $cacheM->GetCache($options);
        
        $this->yunset($cache);
        
        if (!empty($tmp)) {
            
            $this->yunset('tplurl', $url);
            $this->yuntpl(array('resume/' . $url['url'] . '/index'));
        } else {
            $this->yuntpl(array('resume/resume'));
        }
    }
    
    /**
     * @desc   简历详情  浏览数量
     * 2019-06-14
     */
    function GetHits_action() {
        $id = intval($_GET['id']);
        
        if (empty($id)) {
            echo 'document.write(0)';
        }
        
        $resumeM = $this->MODEL('resume');
        $resumeM->addExpectHits($id);
        
        $hits = $resumeM->getExpect(array('id' => $id), array('field' => '`hits`'));
        
        echo 'document.write(' . $hits['hits'] . ')';
    }
    
    /**
     * @desc 简历详情 - 举报简历
     * 2019-06-14
     */
    function report_action() {
        
        $_POST = $this->post_trim($_POST);
        
        if ($_POST['reason'] == '') {
            
            $this->ACT_layer_msg('请选择举报理由', 8);
        }
        if (empty($this->uid)) {
            $this->ACT_layer_msg('请先登录!', 8);
        }
        
        if ($_POST['reason'] == '') {
            $this->ACT_layer_msg('举报内容不能为空!', 8);
        }
        
        $Where = array(
            'uid'      => $this->uid,
            'usertype' => $this->usertype,
            'eid'      => (int)$_POST['r_eid']
        );
        
        $resumeM = $this->MODEL('resume');
        $jlres = $resumeM->openResumeCheck($Where);
        if ($jlres != 1) {
            $this->ACT_layer_msg('下载之后才可以举报哦!', 8);
        }
        
        $data = array(
            'reason'    => $_POST['reason'],
            'c_uid'     => (int)$_POST['r_uid'],
            'inputtime' => time(),
            'p_uid'     => $this->uid,
            'did'       => $this->userid,
            'usertype'  => $this->usertype,
            'eid'       => (int)$_POST['r_eid'],
            'r_name'    => $_POST['r_name'],
            'username'  => $this->username
        );
        $reportM = $this->MODEL('report');
        $return = $reportM->ReportResume($data);
        $this->ACT_layer_msg($return['msg'], $return['errcode'], $_SERVER['HTTP_REFERER']);
    }
    
    /**
     * 浏览历史记录
     */
    function history_action() {
        
        if ($_POST['eid'] && ($this->usertype == 2 || $this->usertype == 3)) {
            
            $resumeM = $this->MODEL('resume');
            
            $eid = intval($_POST['eid']);
            
            $resume_expect = $resumeM->getExpect(array('id' => $eid), array('field' => '`uid`'));
            
            $time = time();
            
            $cookieM = $this->MODEL('cookie');
            
            $cookieEids = $_COOKIE['lookresume'];
            
            if ($cookieEids) {
                
                $resumeArr = @explode(',', $cookieEids);
                
                if (!in_array($eid, $resumeArr)) {
                    
                    $lookResumeIds = $cookieEids . "," . $eid;
                } else {
                    
                    $lookResumeIds = $cookieEids;
                }
            } else {
                
                $lookResumeIds = $eid;
            }
            
            $cookieM->setcookie('lookresume', $lookResumeIds, $time + 3600);
            
            $lookM = $this->MODEL('lookresume');
            
            // 浏览记录处理
            $lookM->browseResume(array(
                'euid'     => $resume_expect['uid'],
                'uid'      => $this->uid,
                'usertype' => $this->usertype,
                'did'      => $this->config['did'],
                'eid'      => $eid
            ));
            
        }
    }
}
 
?>