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
<?php
 
class index_controller extends company{
    function index_action(){
        
        $this -> public_action();
    
        $statis            =    $this->company_satic();
        $jobM            =    $this->MODEL('job');
        $userinfoM        =    $this->MODEL('userinfo');
        $downresumeM    =    $this->MODEL('downresume');
        $companyorderM    =    $this->MODEL('companyorder');
        $MsgM            =    $this -> MODEL('msg');
        $couponM        =    $this -> MODEL('coupon');
 
        if($this->config['sy_couponday']>0){
            $coupontime     =           $this->config['sy_couponday'];
        }else{
            $coupontime     =           30;
        }
 
        $coupon         =   $couponM->getCouponNum(array('uid' => $this->uid, 'status' => 1, 'validity' => array(array('>',time(),'AND'),array('<', strtotime('+ '.$coupontime.' days'),'AND'))));
        $this->yunset('coupon', $coupon);
    
        $couponhist        =   $couponM->getCouponListOne(array('uid' => $this->uid, 'status' => 1, 'state' =>array('<>',1), 'validity' => array('>', time()),'orderby'=>array('ctime,desc')));
        $this->yunset('couponhist', $couponhist);
 
        //收到的简历
        $des_resume        =    $jobM->getSqJobNum(array('com_id'=>$this->uid,'isdel'=>9,'type'=>array('<>',3)));
        $this->yunset('des_resume',$des_resume);
        
        //求职者咨询
        $msgnum            =    $MsgM -> getMsgNum(array('job_uid'=>$this->uid,'status'=>1));
        $this->yunset('msgnum',$msgnum);
 
        //谁看过我
        $look_jobnum    =    $jobM -> getLookJobNum(array('com_id'=>$this->uid,'com_status'=>0), array('usertype' => $this->usertype));
        $this->yunset('look_jobnum',$look_jobnum);
        
        //浏览量
        $comM           =   $this->MODEL('company');
        $hitsExporue    =   $comM->getHitsExpoure($this->uid);
        $this->yunset(array('hitsNum' => $hitsExporue['hits'], 'expoureNum' => $hitsExporue['expoure']));
 
        //收到未查看的简历
        $de_resume        =    $jobM->getSqJobNum(array('com_id'=>$this->uid,'isdel'=>9,'is_browse'=>'1','type'=>array('<>',3)));
        $this->yunset('de_resume',$de_resume);
        
        //下载简历
        $down_resume    =    $downresumeM->getDownNum(array('comid'=>$this->uid,'usertype'=>$this->usertype,'isdel'=>9));
        $this->yunset('down_resume',$down_resume);
        // 对我感兴趣
        $atnM  =  $this->MODEL('atn');
        $atn   =  $atnM->getantnNum(array('sc_uid'=>$this->uid,'sc_usertype'=>2));
        $this->yunset('atn',$atn);
        //刷新职位数量
        if((int)$statis['vip_etime'] == 0){
 
            $breakWhere    =    array(
                'uid'    =>  $this -> uid,
                'opera'    =>  1,
                'type'    =>  4,
                'ctime'    =>    array('>=', $statis['vip_stime'])
            );
        }else{
            $breakWhere     =    array(
                'uid'                 =>  $this -> uid,
                'opera'               =>  1,
                'type'                =>  4,
                'PHPYUNBTWSTART_A'    =>  '',
                'ctime'               =>  array(
                    '0'   =>  array('>=', $statis['vip_stime'], 'AND'),
                    '1'   =>  array('<=', $statis['vip_etime'], 'AND')
                ),
                'PHPYUNBTWEND_A'      =>  ''
            );
        }
        $breakjobNums    =    $this -> MODEL('log') -> getMemberLogNum($breakWhere);
        $this->yunset('breakjobNums', $breakjobNums);
 
        //正常职位数,判断是否弹出刷新职位
        $normal_job_num    =    $jobM -> getJobNum(array('uid' => $this->uid, 'state' => '1' , 'r_status' => 1, 'status' => 0));
        $this->yunset('normal_job_num',$normal_job_num);
        
        //今日未刷新职位,判断是否弹出刷新职位
        $un_refreshjob_num        =    $jobM -> getJobNum(array('uid' => $this->uid,'lastupdate' => array('<' , strtotime('today')),'state'=>'1','r_status'=>1,'status'=>0));
        $this->yunset('un_refreshjob_num',$un_refreshjob_num);
    
        //获取职位id、name
        $jobwhere['uid']        =   $this->uid;
        $jobwhere['state']        =    1;
        $jobwhere['r_status']    =    1;
        $jobwhere['status']        =    0;
        $jobsA    =   $jobM -> getList($jobwhere);//招聘中职位
        $jobs    =    $jobsA['list'];
 
        if($jobs && is_array($jobs)){//获取职位ID
         
            foreach($jobs as $key=>$v){
                
                $ids[]            =    $v['id'];
                if ($key<3){
                    $jobnames[]    =    $v['name'];
                }
            }
            $jobids             =    "".pylode(",",$ids)."";
            $jobnames             =    "".@implode(",",$jobnames)."";
            if (count($jobs)>3){
                $jobnames        .=    "等,<span style='color:blue'>共".count($jobs)."个职位</span>。";
            }
            $this->yunset('jobids',$jobids);
            $this->yunset('jobnames',$jobnames);
        }
         
        $member    =    $userinfoM->getInfo(array('uid'=> $this->uid),array('field'=>'`login_date`,`status`,`wxid`,`unionid`'));
        $this->yunset('member',$member);
        
        if($statis['rating']>0){
            //获取会员图标
            $company_rating    =    $this->MODEL('rating')->getInfo(array('id'=>$statis['rating']));
              $this->yunset('company_rating',$company_rating);
        }
    
        //浏览记录
        $look_resume    =    $this->MODEL('lookresume')->getLookNum(array('com_id'=>$this->uid,'com_status'=>'0'));
        $this->yunset('look_resume',$look_resume);
        //未付款订单
        $paying            =   $companyorderM -> getCompanyOrderNum(array('uid' => $this->uid,'usertype' => $this->usertype,'order_state' => '1'));
        $this->yunset('paying',$paying);
        
        //企业资质认证查询
        $yyzz            =   $this->MODEL('company')->getCertInfo(array('uid' => $this -> uid, 'type' => 3), array('field' => '`status`'));
        $this->yunset('yyzz', $yyzz);
        
        //查询优惠券sy_couponday
        $this->cookie->SetCookie('jobrefresh','1',(strtotime('today') + 86400));
        //判断微信绑定情况
        if($member['wxid']==''&&$member['unionid']=='' && $this->config['wx_author']=='1'){
            $this->yunset('qrcode', 1);
        }
        $this->cookie->SetCookie('gzh','1',(strtotime('today') + 86400));
                
        $company    =    $this->comInfo['info'];
 
        if($company['hy']== ''){
            
            if($_COOKIE['indextip']=='1'){
                $indextip = 0;
            }else{
                $this->cookie->SetCookie('indextip','1',(strtotime('today') + 86400));
                $indextip = 1;
            }
            
            $this->yunset('indextip',$indextip);
        }else{
 
            $this->cookie->SetCookie('indextip','',(strtotime('today') - 86400));
 
        }
 
        $this->yunset('company', $this->comInfo['info']);
        
        $ggnum    =    0;
        if(empty($this->spid)){
            if($company['r_status'] !=1){
                $ggnum++;
            }
            if(empty($company['name'])){
                $ggnum++;
            }
            if($statis['vipIsDown']==1){
                $ggnum++;
            }elseif($statis['remind']==1 && empty($statis['vipIsDown'])){
                $ggnum++;
            }
        }
        $this->yunset('ggnum', $ggnum);
 
        $WhbM       =   $this->MODEL('whb');
        $maxNum     =   $normal_job_num > 6 ? 6 : $normal_job_num;
        $syComHb    =   $WhbM->getWhbList(array('type' => 2, 'isopen' => 1, 'num' => $maxNum ));
        $this->yunset('hbNum', count($syComHb));
 
        if(!empty($syComHb)){
            $hbids  =   array();
            foreach ($syComHb as $hk => $hv) {
                $hbids[] = $hv['id'];
            }
            $this->yunset('hbids', $hbids);
        }
        $this->yunset('hb_uid', $this->uid);
         $this->com_tpl('index');
    }
    function couponsee_action(){
        //优惠券自动查看
        $couponM        =            $this->MODEL('coupon');
        $where['uid']    =            $this->uid;
        $where['id']    =            intval($_POST['couponid']);
        $data            =            array(
            'state'        =>            1
        );
        $couponM->upCouponList($where,$data);
    }
    
    function resumeajax_action(){
        $jobM        =    $this->MODEL('job');
        $resumeM    =    $this->MODEL('resume');
        
        
        $jobwhere['com_id']        =   $this->uid;
        $jobwhere['state']        =    1;
        $jobwhere['r_status']    =    1;
        $jobwhere['status']        =    0;
        
        $joblist  =     $jobM->getList($jobwhere,array('field'=>'`job1_son`,`job_post`,`cityid`'));
        $joblist  =  $joblist['list'];
        $cityids  =  array();
        if(is_array($joblist) && !empty($joblist)){
            foreach($joblist as $v){
                if (!empty($v['cityid'])){
                    $cityids[]                    =    $v['cityid'];
                }
                
                $wherea['PHPYUNBTWSTART_A']        =    '' ;
                if($v['job1_son']){
                    $wherea['job_classid'][]    =    array('findin',$v['job1_son']);
                }
                if($v['job_post']){
                    $wherea['job_classid'][]    =    array('findin',$v['job_post'],'OR');
                }
                $wherea['PHPYUNBTWEND_A']        =    '' ;
            }
            
            $whereSql['PHPYUNBTWSTART_B']        =    '' ;
            $whereSql['job_classid']            =    $wherea['job_classid'];
            //$whereSql['cityid']                    =    array('in',pylode(',',$cityids));
            $whereSql['PHPYUNBTWEND_B']            =    '' ;
        }
        $blackM        =    $this->MODEL('black');
        $blacklist    =    $blackM->getBlackList(array('p_uid'=>$this->uid),array('field'=>'`c_uid`'));
        if(is_array($blacklist) && !empty($blacklist)){
            foreach($blacklist as $v){
                $bids[]=$v['c_uid'];
            }
            
            $nwhereSql['uid']        =    $whereSql['uid']             =    array('notin',pylode(',',$bids)) ;
        }
        $cityids   = array_unique($cityids);
        $resumeeid = $resumeM->getResumeCityClassList(array('cityid'=>array('in',pylode(',',$cityids))),array('field'=>'`eid`'));
        foreach($resumeeid as $v){
            $eids[]=$v['eid'];
        }
        $nwhereSql['id']            =    $whereSql['id']                =    array('in',pylode(',',$eids));
        $nwhereSql['uname']            =    $whereSql['uname']            =    array('<>','');
        $nwhereSql['status']        =    $whereSql['status']            =    1;
        $nwhereSql['r_status']        =    $whereSql['r_status']        =    1;
        $nwhereSql['state']            =    $whereSql['state']            =    1;
        $nwhereSql['job_classid']    =    $whereSql['job_classid']    =    array('<>','');
        $nwhereSql['defaults']        =    $whereSql['defaults']        =    1;
        $nwhereSql['orderby']        =    $whereSql['orderby']        =    'lastupdate,desc';
        $nwhereSql['limit']            =    $whereSql['limit']            =    6;
        
        $resumes         =     $resumeM->getList($whereSql);
        
        $resume            =    $resumes['list'];
        if(empty($resume)){
            
            $resumes     =     $resumeM->getList($nwhereSql);
            $resume        =    $resumes['list'];
        }
        $list            =    array();
        if ($resume){
            foreach ($resume as $v){
                $uids[]    =    $v['uid'];
            }
            if ($uids){
                $user     =     $resumeM->getResumeList(array('uid'=>array('in',pylode(',',$uids))),array('field'=>'`uid`,`name`,`nametype`,`sex`,`photo`,`phototype`,`photo_status`,`def_job`'));
            }
            foreach ($resume as $k=>$v){
                $list[$k]['username_n']='';
                foreach ($user as $val){
                    if ($v['uid']==$val['uid']){
                        $list[$k]['username_n']     =    $val['name_n'];
                        $list[$k]['photo']            =    $val['photo'];
                    }
                }
                $list[$k]['resumeurl']                =    Url('resume',array('c'=>'show','id'=>$v['id']));
                
                $list[$k]['edu_n']                    =    $v['edu_n']?$v['edu_n'].'学历':'';
                $list[$k]['exp_n']                    =    $v['exp_n']?$v['exp_n'].'经验':'';
                
                $jobname                            =    @explode(',', $v['job_classname']);
                $list[$k]['jobname']                =    $jobname['0'];
                
                $cityname                            =    @explode(',', $v['city_classname']);
                $list[$k]['cityname']                =    $cityname['0'];
            }
        }
        $data['list']=$list;
        echo json_encode($data);die;
    }
    function logout_action(){
 
        $this->logout();
 
    }
}
?>