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
<?php
 
class lt_job_controller extends company{
  
    function index_action(){
    
        $ltjobM          =   $this -> MODEL('lietoujob');
        $jobM           =   $this -> MODEL('job');
        
        $uid            =   $this->uid;
        $where['uid']     =   $uid;
 
        $jobM       =   $this->MODEL('job');
        $this->yunset('jobNum', $jobM->getJobNum($where));
        $partM          =   $this -> MODEL('part');
        $this->yunset('partNum', $partM->getpartJobNum($where));
        $this->yunset('ltjobNum', $ltjobM->getLtjobNum($where));
        $this -> yunset('i_know_ltjob', !empty($_COOKIE['i_know_ltjob_' . $this->uid]) ? 1 : 0);
        
        $where['usertype']     =   $this->usertype;
        
        $urlarr["c"]    =   "lt_job";
        $urlarr["page"]    =   "{{page}}";
        $pageurl         =     Url('member',$urlarr);
        $pageM            =    $this  -> MODEL('page');
        $pages            =    $pageM -> pageList('lt_job',$where,$pageurl,$_GET['page']);
        
        $where['limit']    =   $pages['limit'];
 
        $rows             =    $ltjobM -> getList($where,array('field'=>'job_name,status,id,lastupdate,edate,rec,rec_time,zp_status,hits,statusbody'));
 
        if($rows && is_array($rows)){
      
            $jobs=array();
      
            foreach($rows as $key=>$val){
        
                $rows[$key]['num']    =    0;
                $jobids[]            =    $val['id'];
        
            }
      
            $swhere['com_id']       =   $uid;
            $swhere['groupby']      =      'com_id';
            $swhere['job_id']       =      array('in', pylode(',', $jobids));
            $nums    =    $jobM -> getSqJobList($swhere,array('field'=>'job_id,count(id) as num'));
            
            foreach($rows as $key=>$val){
        
                foreach($nums as $v){
 
                    if($val['id']==$v['job_id']){
            
                        $rows[$key]['num']=$v['num'];
                    }
                }
            } 
        }
        $this->yunset('rows',$rows);
 
        $this->company_satic();
        $this->public_action();
        
        $this->com_tpl('lt_job');
    }
    function jobset_action(){
    
        $ltjobM           =   $this -> MODEL('lietoujob');
        $logM              =      $this -> MODEL('log');
        //招聘状态
        $status           =   intval($_GET['status']);
        
        if($status){
      
            $where['id']    =    intval($_GET['id']);
            $where['uid']    =    $this->uid;
 
            if($status=='2'){
                $data['zp_status']    =    0;
            }else{
                $data['zp_status']    =    1;
            }
              $ltjobM ->  upInfo($where,$data);
              $logM   ->  addMemberLog($this->uid,$this->usertype,'设置猎头职位招聘状态',1,2);
            $this->layer_msg('设置成功!',9,0,$_SERVER['HTTP_REFERER']);
        }
    }
    
    function add_action(){
 
        $company    =   $this -> comInfo['info'];
 
        if(!$company['name'] || ! $company['provinceid'] || (!$company['linktel'] && ! $company['linkphone'])){
            $this->ACT_msg('index.php?c=info', '请先完善基本资料!');
        }
        $this->yunset('company', $company);
        // 身份认证信息,强制邮箱、手机、企业资质认证配置--start
        $msg        =   array();
 
        $isallow_addjob =   '1';
 
        $url        =   $this->spid ? 'index.php' : 'index.php?c=binding';
 
        if ($this->config['com_enforce_emailcert'] == '1') {
            if ($company['email_status'] != '1') {
 
                $isallow_addjob =   '0';
                $msg[]          =   '邮箱认证';
            }
        }
        if ($this->config['com_enforce_mobilecert'] == '1') {
            if ($company['moblie_status'] != '1') {
 
                $isallow_addjob =   '0';
                $msg[]          =   '手机认证';
            }
        }
 
        if ($this->config['com_enforce_licensecert'] == '1') {
 
            $comM   =   $this->MODEL('company');
            $cert   =   $comM -> getCertInfo(array('uid'=>$this->uid,'type'=>3), array('field' => '`uid`,`status`'));
 
            if ($company['yyzz_status'] != '1' && (empty($cert) || $cert['status'] == 2)) {
 
                $isallow_addjob =   '0';
                $msg[]          =   '企业资质认证';
            }
        }
 
        if ($isallow_addjob == '0') {
            if ($this->spid) {
 
                $this -> ACT_msg($url, '请联系主账号,先完成'.implode('、', $msg).'!');
            }else{
 
                $this -> ACT_msg($url, '请先完成'.implode('、', $msg).'!');
            }
        }
 
        if ($this->config['com_enforce_setposition'] == '1') {
            if (empty($company['x']) || empty($company['y'])) {
 
                $this->ACT_msg('index.php?c=map', '请先完成地图设置!');
            }
        }
 
        if ($this->config['com_gzgzh'] == '1') {
 
            $userinfoM    =    $this->MODEL('userinfo');
            $uInfo        =    $userinfoM->getInfo(array('uid' => $this->uid),array('field' => '`wxid`,`unionid`'));
            if (empty($uInfo['wxid']) && empty($uInfo['unionid'])) {
 
                $this->cookie->SetCookie('gzh','',(strtotime('today') - 86400));
                $this->ACT_msg('index.php', '请先关注公众号!');
            }
        }
 
        $statisM    =    $this -> MODEL('statis');
 
        $statics    =    $this->company_satic();
    
        if($statics['addjobnum']==0){//会员过期
            if($this->spid){
                
                $this->ACT_msg('index.php', '当前账号会员已到期,请联系主账号进行升级!', 8);
            }else{
                
                $this->ACT_msg("index.php?c=right","你的会员已到期!",8);
            }
        }
 
        if($statics['addjobnum']==2){//套餐会员,发布职位套餐为0 
            if($this->config['integral_job']!='0'){
                if($this->spid){
                    
                    $this->ACT_msg('index.php', '您的套餐已用完,请联系主账号进行分配!', 8);
                }else{
 
                    $this->ACT_msg("index.php?c=right","你的套餐已用完!",8);
                }
            }else{
                if($this->spid){
                    
                    $statisM->upInfo(array('job_num'=>1),array('uid'=>$this->spid,'usertype'=>$this->usertype));
                }else{
 
                    $statisM->upInfo(array('job_num'=>1),array('uid'=>$this->uid,'usertype'=>$this->usertype));
                }
            }
        }
 
        $this->yunset($this->MODEL('cache')->GetCache(array('lt','com','ltjob','city','lthy')));
         
        $this->public_action();
 
        $this->com_tpl('lt_jobadd');
    }
 
    function edit_action()
    {
 
        $this->public_action();
        $this->company_satic();
 
        $this->yunset($this->MODEL('cache')->GetCache(array('lt', 'com', 'ltjob', 'city', 'lthy')));
 
        $ltJobM =   $this->MODEL('lietoujob');
        $row    =   $ltJobM->getInfo(array('uid' => $this->uid, 'id' => intval($_GET['id'])));
 
        $this->yunset('row', $row);
 
        $this->com_tpl('lt_jobadd');
    }
    
    function save_action(){
 
          $ltjobM             =   $this -> MODEL('lietoujob');
      
          if($_POST['submit']){
 
            $company    =   $this -> comInfo['info'];
            
            $rstaus     =   $company['r_status'];
 
            $post    =     array(
                'job_name'        =>    $_POST['job_name'],
                
                'jobone'           =>    $_POST['jobone'],
                'jobtwo'           =>    $_POST['jobtwo'],
                
                'department'       =>    $_POST['department'],
                'report'           =>    $_POST['report'],
 
                'provinceid'      =>    $_POST['provinceid'],
                'cityid'           =>    $_POST['cityid'],
                'three_cityid'    =>    $_POST['three_cityid'],
 
                'minsalary'      =>    $_POST['minsalary'],
                'maxsalary'        =>    $_POST['maxsalary'],
 
                'constitute'       =>    @implode(',',$_POST['constitute']),
                'job_desc'        =>    $_POST['job_desc'],
                'age'             =>    $_POST['age'],
                'sex'             =>    $_POST['sex'],
                'exp'             =>    $_POST['exp'],
                'edu'             =>    $_POST['edu'],
                'eligible'        =>    $_POST['eligible'],
                'welfare'          =>    @implode(',',$_POST['welfare']),
                'language'         =>    @implode(',',$_POST['language']),
                'rebates'         =>    $_POST['rebates'],
                'other'          =>    $_POST['other'],
                'r_status'      =>    $rstaus,
                'lastupdate'      =>    time(),
                'uid'           =>    $this->uid,
                'spid'           =>    $this->spid,
                'usertype'        =>    $this->usertype,
                'did'            =>    $this->userdid
            );
 
            $data    =    array(
                'post'    =>    $post,
                'id'    =>    !empty($_POST['id']) ? intval($_POST['id']) : ''
            );
 
             
            $return    =    $ltjobM->addLtJobInfo($data);
 
              if($return['errcode']==9){
                  
                $this->ACT_layer_msg($return['msg'],$return['errcode'],"index.php?c=lt_job");
            }else{
                
                $this->ACT_layer_msg($return['msg'],$return['errcode']);
            }
        } 
    }
    function del_action(){
 
        $ltjobM    =   $this -> MODEL('lietoujob');
        $logM    =    $this -> MODEL('log');
        
        $delID    =    is_array($_POST['checkboxid']) ? $_POST['checkboxid'] : $_GET['id'];
        
        $delRes    =    $ltjobM -> delLietouJob($delID,array('uid'=>$this->uid));
        
        $logM -> addMemberLog($this->uid,$this->usertype,"删除猎头职位",1,3);
 
        $this -> layer_msg($delRes['msg'], $delRes['errcode'], $delRes['layertype'], $_SERVER['HTTP_REFERER']);
 
    }
 
    // 刷新猎头职位方法,套餐处理集合到comtc.model.php类里面
    function refresh_ltjob_action(){
 
        if($_POST){
            $comtcM    =    $this->MODEL('comtc');
            
            $_POST['spid']        =    $this->spid;
            $_POST['uid']        =    $this->uid;
            $_POST['usertype']    =    $this->usertype;
            
             $return    =    $comtcM->refresh_ltjob($_POST);
      
             if($return['status']==1){//猎头职位刷新成功
                
                echo json_encode(array('error'=>1,'msg'=>$return['msg']));
 
            }else if($return['status']==2){//套餐不足,金额消费
                
                echo json_encode(array(
                    'error'     =>  2,
                    'pro'       =>  $return['pro'],
                    'online'    =>  $return['online'],
                    'integral'  =>  $return['integral'],
                    'jifen'     =>  $return['jifen'],
                    'price'     =>  $return['price']
                ));
            }else{
                //猎头职位刷新失败
                echo json_encode(array('error'=>3,'msg'=>$return['msg'],'url'=>$return['url']));
            }
        }else{
            echo json_encode(array('error'=>3,'msg'=>'参数错误,请重试!'));
        }
    } 
}
?>