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
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
<?php
 
class index_controller extends user{
    //首页
    function index_action(){
        $atnM            =    $this -> MODEL('atn');
        $JobM            =    $this -> MODEL('job');
        $cacheM            =    $this -> MODEL('cache');
        $resumeM        =    $this -> MODEL('resume');
        $userinfoM        =    $this -> MODEL('userinfo');
        $lookresumeM    =    $this -> MODEL('lookresume');
        $this -> public_action();
        
        $this -> yunset($cacheM -> GetCache(array('user','com','job')));
        
        //面试通知数
        $yqnum        =    $JobM -> getYqmsNum(array('uid'=>$this->uid,'isdel'=>9));
        $this -> yunset("yqnum",$yqnum); 
        
        //谁看了我的简历
        $lookNum    =    $lookresumeM -> getLookNum(array('uid'=>$this->uid,'status'=>array('<>',1)));
        $this -> yunset("lookNum",$lookNum);
        //我的关注
        $where['uid']                =    $this->uid;
        $where['sc_usertype']        =    '2';
        $where['PHPYUNBTWSTART_A']    =    '' ;
        $where['xjhid'][]            =    array('=',0) ;
        $where['xjhid'][]            =    array('isnull','','OR') ;
        $where['PHPYUNBTWEND_A']    =    '' ;
        $atncomnum        =    $atnM -> getAtnNum($where);
        $atnltnum        =    $atnM -> getAtnNum(array('uid'=>$this->uid,'sc_usertype'=>'3'));
        $atnacademynum    =    $atnM -> getAtnNum(array('uid'=>$this->uid,'sc_usertype'=>'5'));
        $atnxjhnum        =    $atnM -> getAtnNum(array('uid'=>$this->uid,'sc_usertype'=>'2','xjhid'=>array('<>','')));
        $atnnum            =    $atncomnum+$atnltnum+$atnacademynum+$atnxjhnum;
        $this->yunset('atnnum',$atnnum);
        //判断今天是否已刷新简历
        $time        =    strtotime(date("Y-m-d 00:00:00"));
        $this -> yunset("time",$time);
        
        $where    =   array();
        
        $where['uid']                =    $this->uid;
        $where['sc_usertype']        =    '2';
        $where['PHPYUNBTWSTART_A']    =    '' ;
        $where['xjhid'][]            =    array('=',0) ;
        $where['xjhid'][]            =    array('isnull','','OR') ;
        $where['PHPYUNBTWEND_A']    =    '' ;
        $where['groupby']           =   'sc_uid';
        
        $auids    =   $atnM -> getatnList($where,array('field'=>'uid,sc_uid','utype'=>'company'));
        $this -> yunset('ainfo',$auids);
        
        //判断我是否有简历
        $eData    =   array(
            'field'   => '`lastupdate`,`jobstatus`,`id`,`name`'
        );
        
        $rlist  =  $resumeM -> getExpectByUid($this->uid,$eData);
        $this -> yunset('rlist',$rlist);
 
        $expectInfo = $resumeM->getExpect(array('uid'=>$this->uid,'defaults'=>'1'),array('needCache'=>1,'member'=>1));
        $this->yunset('expectInfo',$expectInfo);
        if($this -> config['resume_sx']==1  && $_COOKIE['amtype'] != '1'){//登录自动简历刷新,在后台配置、管理员登录的,不需要刷新
 
            if($rlist['id']){
                
                $resumeM -> upInfo(array('id'=>$rlist['id'],'uid'=>$this->uid),array('eData'=>array('lastupdate'=>time())));
                
                $resumeM -> upResumeInfo(array('uid'=>$this->uid),array('rData'=>array('lastupdate'=>time()), 'port' => 1));
            }
        }
        //当日首次进入会员中心 如未刷新进行提醒
        $this -> cookie -> SetCookie("exprefresh",'1',time() + 86400);
        
        //微信绑定判断
        $member        =    $userinfoM -> getInfo(array('uid'=>$this->uid),array('field'=>'`unionid`,`wxid`'));
        $this -> yunset("member",$member);
        if($member['wxid']=='' && $member['unionid']=='' && $this->config['wx_author']=='1'){
            
            $this -> yunset("wxbindshow",1);
            $this -> cookie -> SetCookie("wxbd",'1',time() + 86400);
        }
        
        //问好语
        $hours        =    date('H');
        if($hours<12){
            $wenhou    =    '上午好~';
        }elseif($hours<24){
            $wenhou    =    '下午好~';
        }
        $this -> yunset('wenhou',$wenhou);
        
        if ($this->config['sy_spview_web'] == 1){
            // 有可以参加的视频面试
            $spviewM  =  $this->MODEL('spview');
            $canroom  =  $spviewM -> canRoom(array('uid'=>$this->uid,'status'=>0));
            
            $this->yunset('canroom', $canroom);
            $this -> cookie -> SetCookie("spview",'1',time() + 86400);
        }
        
        $this -> user_tpl('index');
    }
 
    /* 会员中心首页,简历信息载入 */
    function resumeajax_action(){
 
        $resumeM    =    $this -> MODEL('resume');
    
        if($_GET['rand']){
        
            $eData  =  array(
                'field'      =>  'id,name,job_classid,city_classid,hits,jobstatus,integrity,minsalary,maxsalary,doc,tmpid,r_status,topdate,lastupdate,status,state',
                'needCache'  =>  1  
            );
 
            if($_GET['id']){
                
                $data        =    $resumeM -> getExpect(array('uid'=>$this->uid,'id'=>intval($_GET['id'])),$eData);
            }else{
                
                $data       =   $resumeM -> getExpectByUid($this->uid, $eData);
            }
            $data['name']    =    mb_substr($data['name'],0,10,'utf8');
            
            if($data['job_classid']){
                $jobname    =    explode(',',$data['job_classname']);
                $data['jobname']=    $jobname[0];
            }
            $data['lastupdate']    =    date("Y-m-d H:i:s",$data['lastupdate']);
            
            $user_resume        =    $resumeM->getUserResumeInfo(array('eid'=>$data['id'],'uid'=>$this->uid));
            
            $data['skill']        =    $user_resume['skill'];
            $data['work']        =    $user_resume['work'];
            $data['project']    =    $user_resume['project'];
            $data['edu']        =    $user_resume['edu'];
            $data['training']    =    $user_resume['training'];
            $data['cert']        =    $user_resume['cert'];
            $data['other']        =    $user_resume['other'];
            
            $resume                =    $resumeM->getResumeInfo(array('uid'=>$this->uid),array('field'=>'`description`'));
            $data['description']        =    $resume['description'];
            if($data['topdate']>1){
                $data['topdatetime']    =    $data['topdate']-time();
                $data['topdate']        =    date("Y-m-d",$data['topdate']);
            }else{
                $data['topdate']        =    '未设置';
            }
            $eDatas['field']    =    'id,name,job_classid,city_classid,hits,jobstatus,integrity,minsalary,maxsalary,doc,tmpid,r_status,topdate,lastupdate,status,state';
            $data['url']        =    Url('resume',array('c'=>'show','id'=>$data['id']));
            $rlist    =    $resumeM->getList(array('uid'=>$this->uid,'orderby'=>'defaults,desc'),$eDatas);
            $resumelist    =    "";
            foreach($rlist['list'] as $v){
                
                $resumelist    .=    "<li><a href=\"javascript:showresumelist('".$v['id']."');\">".$v['name']."</a></li>";
            }
            $html    =    '<span>'.$data['name'].'</span><div class="index_resume_my_n_list" id="resume_expect'.$data['id'].'" style="display:none;"><ul>'.$resumelist.'</ul></div>';
            $data['resumelist']    =    $html;
            $data['num']        =    count($rlist);
            $data['uid']        =    $this->uid;
            echo json_encode($data);
        }
    }
    function jobajax_action(){
        $resumeM  =  $this -> MODEL('resume');
        $eData    =  array(
            'field'      =>  '`job_classid`,`city_classid`',
            'needCache'  =>  1
        );
        $resume            =    $resumeM -> getExpectByUid($this->uid,$eData);
 
        $nwhere['sdate']                =    $where['sdate']        =    array('<',time());
        $nwhere['r_status']                =    $where['r_status']    =    1;
        $nwhere['status']                =    $where['status']    =    0;
        $nwhere['state']                =    $where['state']        =    1;
        if($resume['job_classid']!=""){
            $where['PHPYUNBTWSTART_A']    =    '';
            $where['job_post']            =    array('in',$resume['job_classid']);
            $where['job1_son']            =    array('in',$resume['job_classid'],'or');
            $where['PHPYUNBTWEND_A']    =    '';
        }
        if($resume['city_classid']!=""){
            $where['PHPYUNBTWSTART_B']    =    '';
            $where['provinceid']        =    array('in',$resume['city_classid']);
            $where['cityid']            =    array('in',$resume['city_classid'],'or');
            $where['three_cityid']        =    array('in',$resume['city_classid'],'or');
            $where['PHPYUNBTWEND_B']    =    '';
        }
        $nwhere['orderby']                =    $where['orderby']    =    'id,desc';
        $nwhere['limit']                =    $where['limit']        =    12;
        $cdata['field']                    =    'id,uid,name,com_name,cityid,edu,exp,minsalary,maxsalary';
        $cdata['isurl']                    =    'yes';
        $jobM        =    $this -> MODEL('job');
 
        $job        =    $jobM->getList($where,$cdata);
        if(empty($job)){
 
            $job    =    $jobM->getList($nwhere,$cdata);
            $data['isnew']    =    1;
        }
        $list=array();
        if ($job['list']){
            foreach ($job['list'] as $k=>$v){
                $list[$k]['joburl']        = $v['joburl'];
                $list[$k]['comurl']        = $v['comurl'];
                $list[$k]['name']        = mb_substr($v['name'], 0, 10 ,"UTF-8");
                $list[$k]['com_name']    = mb_substr($v['com_name'], 0, 10 ,"UTF-8");
                $list[$k]['jobsalary']    = $v['job_salary'];
                $list[$k]['citytwo']    = $v['job_city_two'];
                $list[$k]['edu_n']        = $v['job_edu']?$v['job_edu']:'不限';
                $list[$k]['exp_n']        = $v['job_exp']?$v['job_exp']:'不限';
            }
        }
        $data['list']=$list;
        echo json_encode($data);die;
    }
}
?>