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
<?php
 
 
class job_controller extends company
{
 
    function index_action()
    {
 
        $this -> public_action();
        $this -> company_satic();
        
        $jobM       =   $this->MODEL('job');
        
        $StatisM    =   $this->MODEL('statis');
        $suid       =   $this->spid ? $this->spid : $this->uid;
        $statis     =   $StatisM -> getInfo($suid, array('usertype' => '2'));
        $this->yunset('statis', $statis);
        
        $urlarr     =   array('c' => 'job', 'page' => '{{page}}');
 
        $uid        =   $this->uid;
        
        $where['uid']    =   $uid;
 
        $partM          =   $this -> MODEL('part');
        $this->yunset('partNum', $partM->getpartJobNum($where));
        $ltjobM          =   $this -> MODEL('lietoujob');
        $this->yunset('ltjobNum', $ltjobM->getLtjobNum($where));
 
        // 关键字刷选
        if ($_GET['keyword']) {
            
            $where['name']      =   array('like', trim($_GET['keyword']));
            $urlarr['keyword']  =   $_GET['keyword'];
        }
        // 职位状态 0:待审核职位 1:招聘中的职位 3:未通过职位 4:已下架职位 5:所有职位
        if($_GET['type']==2){
            $urlarr['type']        =   $_GET['type'];
        }
        if ($_GET['w'] == 4) {
            
            $where['status']    =   '1';
            $urlarr['w']        =   $_GET['w'];
        } elseif ($_GET["w"] == 1) {
 
            $where['status']    =   '0';
            $where['state']     =   '1';
            $urlarr['w']        =   $_GET['w'];
        } elseif ($_GET["w"] == 5) {
 
            $urlarr['w']        =   $_GET['w'];
        } else {
            
            $where['state']     =   $_GET['w'];
            $urlarr['w']        =   $_GET['w'];
        }
        
        $pageurl    =   Url('member', $urlarr);
 
        $pageM      =   $this->MODEL('page');
        $pages      =   $pageM->pageList('company_job', $where, $pageurl, $_GET['page'], $this->config['sy_listnum']);
        if ($pages['total'] > 0) {
            if ($_GET['order']) {
                
                $where['orderby']   =   $_GET['t'].','.$_GET['order'];
                $urlarr['order']    =   $_GET['order'];
                $urlarr['t']        =   $_GET['t'];
            } else {
                
                $where['orderby']   =   array('lastupdate,desc','id,desc');
            }
            
            $where['limit']         =   $pages['limit'];
            $List                   =   $jobM -> getList($where, array('sqjobnum' => 'yes', 'reserve' => 1));
            
            $this->yunset('rows', $List['list']);
        }
 
        // 统计各状态职位数量
        // 职位状态 0:待审核职位 1:招聘中的职位 3:未通过职位 4:已下架职位 5:所有职位
        
        $swhere['com_id']    =    $uid;
        $audit  =   $jobM->getList($swhere, array('field' => "`status`,`state`"));
    
        $w0 = $w1 = $w2 = $w3 = $w4 = $w5 = 0;
 
        if (is_array($audit['list'])) {
            foreach ($audit['list'] as $value) {
 
                if ($value['state'] == '0') {
                    $w0 += 1;
                }
                if ($value['status'] == '0' && $value['state'] == '1') {
                    $w1 += 1;
                }
 
                if ($value['state'] == '3') {
                    $w3 += 1;
                }
                if ($value['status'] == '1') {
                    $w4 += 1;
                }
                $w5 += 1;
            }
        }
        
        $this->yunset(array(
            'w0' => $w0,
            'w1' => $w1,
            'w3' => $w3,
            'w4' => $w4,
            'w5' => $w5
        ));
        $this -> yunset('audit', $w0);
 
        $this->yunset('jobNum', $w5);
 
        $this -> yunset('i_know_job', !empty($_COOKIE['i_know_job_' . $this->uid]) ? 1 : 0);
 
        if (intval($_GET['w']) == 1) {
 
            $WhbM       =   $this->MODEL('whb');
 
            $syJobHb    =   $WhbM->getWhbList(array('type' => 1, 'isopen' => 1));
 
            $this->yunset('hbNum', count($syJobHb));
            if(!empty($syJobHb)){
                $hbids = array();
                foreach ($syJobHb as $hk => $hv) {
                    $hbids[] = $hv['id'];
                }
                $this->yunset('hbids', $hbids);
            }
 
            $type       =   $_GET['type'];
            $this->yunset('type', $type);
            $this->com_tpl('joblist');
        } else {
 
            $this->com_tpl('job');
        }
    }
 
    function opera_action()
    {
        $this->job();
    }
 
    // 刷新职位方法,套餐处理集合到comtc.model.php类里面
    function refresh_job_action()
    {
        if ($_POST) {
 
            $comtcM                =     $this->MODEL('comtc');
            
            $_POST['spid']        =    $this->spid;
            $_POST['uid']        =    $this->uid;
            $_POST['usertype']    =    $this->usertype;
            $_POST['port']      =   1;
            
            $return    =     $comtcM->refresh_job($_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' => '参数错误,请重试!'
            ));
        }
    }
 
    /**
     * 点击知道了,缓存1天
     */
    function i_know_action()
    {
        $opt = $_POST['opt'];
        $time = time();
        $this->cookie->setCookie('i_know_' . $opt . '_' . $this->uid, 1,$time + strtotime(date('Y-m-d 23:59:59')) - $time);
    }
 
    /**
     * 职位推广套餐 查询
     */
    function jobPromote_action()
    {
        $uid    =   $this->uid;
        $type   =   intval($_POST['type']);
        //预留职位自动刷新
        if ($type != 5){
            
            $jobM   =   $this->MODEL('job');
            $return =   $jobM->jobPromote($uid, array('type' => $type, 'spid' => $this->spid));
        }else{
 
            if($this->config['job_auto'] == 0){
 
                $return = array('status' => 1);
            }else{
 
                $return = array('status'=>2);
            }
        }
 
        echo json_encode($return);
        die();
    }
 
    function setJobPromote_action()
    {
        if ($_POST) {
 
            $jobM   =   $this->MODEL('job');
 
            $_POST['uid']       =   $this->uid;
            $_POST['spid']      =   $this->spid;
            $_POST['username']  =   $this->username;
            $_POST['usertype']  =   $this->usertype;
 
            $return = $jobM->setJobPromote($_POST['jobid'], $_POST);
 
            echo json_encode($return);
            die();
        }
    }
 
    function closeJobPromote_action()
    {
        if ($_POST) {
 
            $jobM   =   $this->MODEL('job');
 
            $_POST['uid']       =   $this->uid;
            $_POST['spid']      =   $this->spid;
            $_POST['username']  =   $this->username;
            $_POST['usertype']  =   $this->usertype;
 
            $return = $jobM->closeJobPromote($_POST['jobid'], $_POST);
 
            echo json_encode($return);
            die();
        }
    }
 
    /**
     * 职位竞争力
     */
    function compete_action()
    {
 
        if ($_POST['id']) {
 
            $competeM   =   $this->MODEL('compete');
 
            $List       =   $competeM->comJob($this->uid, (int) $_POST['id'], 2);
 
            if($List['errcode'] != '1'){
                echo $List['errcode'];
            }else{
                 $this->yunset('List', $List);
 
                $this->com_tpl('compete');
            }
           
        }
    }
 
    /**
     * 预约刷新
     */
    function reserveUp_action()
    {
 
        if ($_POST) {
 
            $jobM   =   $this->MODEL('job');
 
            $data   =   array(
 
                'job_id'    =>  $_POST['job_id'],
                'end_time'  =>  strtotime($_POST['end_time']),
                'interval'  =>  $_POST['interval'],
                'status'    =>  $_POST['status'],
                's_time'    =>  $_POST['s_time'],
                'e_time'    =>  $_POST['e_time']
            );
            $return =   $jobM->reserveUpJob($data, array('uid' => $this->uid));
 
            echo json_encode($return);
            die;
        } else {
 
            echo json_encode(array('error' => 0, 'msg' => '参数错误'));
            die;
        }
    }
}
?>