chengkun
2025-05-23 a6f7b382623096b6a00924f418447cf5204e825e
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
<?php
 
class resumeout_controller extends user{
    //简历外发列表
    function index_action(){
 
        $resumeM                =    $this->MODEL('resume');
        $where['uid']            =  $this -> uid;
        $urlarr['c']            =    $_GET['c'];
        $urlarr['page']            =    '{{page}}';
        $pageurl                =    Url('member',$urlarr);
 
        $pageM                    =    $this   ->  MODEL('page');
        $pages                    =    $pageM  ->  pageList('resumeout',$where,$pageurl,$_GET['page']);
        
        if($pages['total'] > 0){
            $where['orderby']    =    'id';
            $where['limit']        =    $pages['limit'];
            
            $List   =  $resumeM  ->  getResumeOutList($where);
        }
        
        $rows        =    $resumeM -> getSimpleList(array('uid'=>$this->uid),array('field'=>"id,name"));
        
        $outmsg =   '';
        $recomM =   $this->MODEL('recommend');
        if (isset($this->config['sy_resumeout_day_num']) && $this->config['sy_resumeout_day_num'] > 0) {
 
            
            $num    =   $recomM->getRecommendNum(array('uid' => $this->uid,'rec_type'=>3));
            
            if ($num > $this->config['sy_resumeout_day_num']) {
                
                $outmsg ='每天最多外发'.$this->config['sy_resumeout_day_num'].'次简历!';
 
            }
            
        }else{
            $outmsg ='外发简历功能已关闭!';
        }
        if(isset($this->config['sy_resumeout_interval']) && $this->config['sy_resumeout_interval'] > 0){
    
            $recrow                 =   $recomM -> getInfo(array('uid' =>$this->uid,'rec_type'=>3, 'orderby' => 'addtime'));
 
            if(!empty($recrow['addtime']) && (time() - $recrow['addtime']) < $this->config['sy_resumeout_interval']){
                $needTime = $this->config['sy_resumeout_interval'] - (time() - $recrow['addtime']);
                if($needTime > 60){
                    $h              =   floor(($needTime % (3600*24)) / 3600);
                    $m              =   floor((($needTime % (3600*24)) % 3600) / 60);
                    $s              =   floor((($needTime % (3600*24)) % 3600 % 60));
                    if($h != 0){
                        $needTime   =   $h.'时';
                    }else if($m != 0){
                        $needTime   =   $m.'分';
                    }
                }else{
                    $needTime       =   $needTime.'秒';
                }
 
                $recs               =   $this->config['sy_resumeout_interval'];
                if($recs>60){
                    $h              =   floor(($recs % (3600*24)) / 3600);
                    $m              =   floor((($recs % (3600*24)) % 3600) / 60);
                    $s              =   floor((($recs % (3600*24)) % 3600 % 60));
                    if($h != 0){
                        $recs       =   $h.'时';
                    }else if($m != 0){
                        $recs       =   $m.'分';
                    }
                }else{
                    $recs           =   $recs.'秒';
                }
                $outmsg ='外发简历间隔不得少于'.$recs.',请'.$needTime.'后再外发!';
            }
        }
        $this->yunset('outmsg',$outmsg);
        $this->public_action();
        $this->yunset('rows',$rows);
        $this->yunset('out',$List);
        $this->user_tpl('resumeout');
    }
    //发送简历外发
    function send_action() {
        $resumeM    =    $this -> MODEL('resume');
        $_POST        =    $this->post_trim($_POST);
        
        $data        =    array(
            'uid'         =>  $this->uid,
            'resume'      =>  $_POST['resume'],
            'email'          =>  $_POST['email'],
            'comname'      =>  $_POST['comname'],
            'jobname'      =>  $_POST['jobname'],
            'resumename'  =>  $_POST['resumename']
        );
        
        $return        =    $resumeM  ->  addResumeOut($data,array('uid'=>$this->uid));
        $this -> ACT_layer_msg($return['msg'],$return['errcode'],$_SERVER['HTTP_REFERER']);
    }
    //删除简历外发记录
    function del_action(){
       $resumeM    =    $this->MODEL('resume');
        if($_GET['id']){
          $return        =    $resumeM  ->  delResumeOut($_GET['id'],array('uid'=>$this->uid,'usertype'=>$this->usertype));
          $this -> layer_msg($return['msg'],$return['errcode']);
        }
    }
}
?>