chengkun
2025-05-12 c49b17b9588306c14ad4b30e6a2c4b8644f3233b
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
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
<?php
 
 
 
class zphnet_controller extends wxapp_controller
{
 
    function list_action()
    {
 
        $time     =  time();
        $zphnetM  =  $this->MODEL('zphnet');
        // 处理分站查询条件
        if (!empty($_POST['did'])){
            $where['did']  =  $_POST['did'];
        }
        //根据后台设置开启/隐藏
        $where['is_open'] = 1;
        $field    =  '`id`,`title`,`starttime`,`endtime`,`pic`,`pnum`,`jnum`,`zpnum`,`anum`,`unum`,`pic_wap`,`banner_wap`';
 
        $zphone  =  $zphnetM->getInfo(array('unix_timestamp(`endtime`)'=>array('>',$time)),array('field'=>'`id`'));
        
        if (!empty($zphone)){
            // 条件排序,进行中在最上面,接着是未开始,最后是已结束
            $field  .=  ',CASE WHEN unix_timestamp(`endtime`)>'.$time.' THEN unix_timestamp(`starttime`)';
            $field  .=  ' WHEN unix_timestamp(`endtime`)<'.$time.' THEN -1*unix_timestamp(`starttime`) END AS `zph_px`';
 
            $where['orderby'] =  ' CASE WHEN unix_timestamp(`starttime`)<"'.$time.'" AND unix_timestamp(`endtime`)>"'.$time.'" THEN 0';
            $where['orderby'] .=  ' WHEN unix_timestamp(`starttime`)>"'.$time.'" THEN 1';
            $where['orderby'] .=  ' WHEN unix_timestamp(`endtime`)<"'.$time.'" THEN 2';
            $where['orderby'] .=  ' END,`zph_px` ASC';
        }else{
            $where['orderby'] =  'unix_timestamp(`starttime`)';
        }
        $page               =  $_POST['page'];
        $limit              =  $_POST['limit'];
        if($page){
 
            $pagenav  =  ($page - 1) * $limit;
            $where['limit']  =  array($pagenav,$limit);
 
        }else{
 
            $where['limit']  =  $limit;
        }
 
        $rows     =  $zphnetM -> getList($where, array('field'=>$field,'utype'=>'wxapp'));
 
        if (!empty($rows)){
 
            $return['list']    =  $rows;
 
            $this->render_json(0, 'ok', $return);
        }else{
            $this->render_json(2);
        }
    }
    function show_action()
    {
        $zid  =  (int)$_POST['id'];
 
        if (!empty($zid)){
 
            $zphnetM  =  $this->MODEL('zphnet');
            $row      =  $zphnetM -> getInfo(array('id'=>$zid));
 
            if (!empty($row)){
 
                $return['enum']  =  0;
 
                if(!empty($_POST['uid']) && !empty($_POST['token'])){
 
                    $member     =   $this->yzToken($_POST['uid'],$_POST['token']);
                    
                    //招聘会进行中记录用户进入记录
                    if ($row['etime'] > 0){
                        
                        $zphnetM->addZphnetUser(array('zid'=>$zid,'uid'=>$member['uid'],'usertype'=>$member['usertype']));
                    }
                    
                    if ($member['usertype'] == 1){
 
                        $resumeM  =  $this->MODEL('resume');
                        $enum     =  $resumeM->getExpectNum(array('uid'=>$member['uid']));
                        $return['enum']  =  $enum;
                    }
 
                    $return['userData']   =   array(
                        'name'  =>  $member['username'],
                        'type'  =>  $member['usertype'],
                        'mtype' =>  2
                    );
                }
                $keyword  =  trim($_POST['keyword']);
                //进入大厅滚动展示
                $horn    =  $zphnetM->getZphnetUser(array('zid'=>$zid,'orderby'=>'ctime','limit'=>10));
                $return['horn']  =  $horn;
                // 企业列表
                if(!empty($row['zw'])){
 
                    $zphArea  =  $zphnetM->getClass(array('id'=>$row['zw']));
                    $return['zphArea']  =  $zphArea;
                    $area   =  $zphnetM->getClassList(array('keyid'=>$row['zw'],'orderby'=>'sort,asc'));
                    $return['area']  =  $area;
                }
                $areaCom    =   $zphnetM->getAreaComList(array('zid'=>$row['id'],'limit'=>'20'),array('zw'=>intval($_POST['zw']),'keyword'=>$keyword));
                $return['areaCom']  =  $areaCom['com'];
                // 数量统计
                $allnum  =  $zphnetM->getZphnetAllNum(array('zid'=>$zid, 'status'=>1));
                $return['allnum'] = $allnum;
                $return['cuswitch'] =  $this->config['sy_user_change'];
                $return['zph']      =  $row;
 
                $return['iosfk']      =  $this->config['sy_iospay'] ;
                $return['chatOpen']      =  $this->config['sy_chat_open'];
                $return['chat_name']  =  $this->config['sy_chat_name'] ? $this->config['sy_chat_name'] : '';
                include(CONFIG_PATH.'db.data.php');
                $return['spview_web']   =  isset($arr_data['modelconfig']['spview']) && isset($this->config['sy_spview_web']) ? $this->config['sy_spview_web'] : 2;
                if ($this->platform == 'ios' && $_POST['provider'] == 'app'){
                    // IOS APP 不支持视频面试
                    $return['spview_web'] = 2;
                }
 
                if(!empty($_POST['uid']) && !empty($_POST['token'])){
 
                    $member     =   $this->yzToken($_POST['uid'],$_POST['token']);
 
                    $uid        =   $member['uid'];
 
                    $usertype   =   $member['usertype'];
                    
                    if($usertype==2){
                        $where    =    array(
                            'uid'        =>    $uid,
                            'did'        =>    $this->config['did'],
                            'state'        =>    1,
                            'status'    =>    0,
                            'r_status'    =>    array('<>',2),
                        );
                        $jobM    =    $this->MODEL('job');
                        
                        $arr    =    $jobM->getList($where,array('field'=>'`id`,name'));
                        
                        $return['joblist']  =  $arr['list'];
                    }
                }
                if (isset($_POST['provider'])){
                    // app用分享数据
                    if ($_POST['provider'] == 'app'){
                        $return['shareData']  =  array(
                            'url'       =>  Url('wap',array('c'=>'zphnet','a'=>'show','id'=>$zid)),
                            'title'     =>  $row['title'],
                            'summary'   =>  mb_substr(strip_tags($row['body']), 0,30,'UTF8'),
                            'imageUrl'  =>  checkpic($row['is_themb_n'],$this->config['sy_wx_sharelogo'])
                        );
                    }
                    // 小程序用seo
                    if ($_POST['provider'] == 'baidu' || $_POST['provider'] == 'weixin'|| $_POST['provider'] == 'toutiao'){
                        $seodata['zph_title']  =  $row['title'];
                        $seodata['zph_desc']   =  $this -> GET_content_desc($row['body']);
                        $this->data        =  $seodata;
                        $seo            =  $this->seo('zphnet_show','','','',false, true);
                        $return['seo']  =  $seo;
                    }
                }
                
                $this->render_json(0, 'ok', $return);
 
            }else{
 
                $this->render_json(2);
            }
        }else{
 
            $this->render_json(2);
        }
    }
    /**
     * 参展企业
     */
    function getComList_action()
    {
        $zid  =  (int)$_POST['id'];
        $zphnetM  =  $this->MODEL('zphnet');
 
        if($_POST['zw']){
            $zphArea  =  $zphnetM->getClass(array('id'=>$_POST['zw']));
            $zw  =  (int)$zphArea['id'];
        }
        if (!empty($zid)){
 
            if($zw){
                $where  =  array('zid'=>$zid,'zw'=>$zw);
            }else{
                $where  =  array('zid'=>$zid);
            }
            $where['orderby']  =  array('sort,desc');
 
            $page   =  $_POST['page'];
            $limit  =  $_POST['limit'];
            if($page){
 
                $pagenav  =  ($page - 1) * $limit;
                $where['limit']  =  array($pagenav,$limit);
 
            }else{
 
                $where['limit']  =  $limit;
            }
            $keyword  =  trim($_POST['keyword']);
 
            $zphnetM  =  $this->MODEL('zphnet');
            $comlist  =  $zphnetM->getAreaComList($where,array('utype'=>'wap','keyword'=>$keyword));
            $return['comlist']  =  $comlist['com'];
 
            $this->render_json(0, 'ok', $return);
        }else{
 
            $this->render_json(2);
        }
 
    }
    /**
     * 求职者大厅
     */
    function hallView_action()
    {
        $zid  =  (int)$_POST['id'];
 
        if (!empty($zid)){
 
            $keyword  =  trim($_POST['keyword']);
 
            $zphnetM  =  $this->MODEL('zphnet');
 
            $page   =  $_POST['page'];
            $limit  =  $_POST['limit'];
            if($page){
 
                $pagenav  =  ($page - 1) * $limit;
                $limit  =  array($pagenav,$limit);
            }
 
            $hall     =  $zphnetM->getZphnetUser(array('zid'=>$zid),array('resume'=>$limit,'keyword'=>$keyword));
            $return['hall']  =  count($hall) ? $hall : array();
 
            $this->render_json(0, 'ok', $return);
        }else{
 
            $this->render_json(2);
        }
 
    }
    /**
     * 保存查看企业、职位记录
     */
    function setLook_action()
    {
 
        $zid    =  intval($_POST['id']);
        $jobid  =  intval($_POST['jobid']);
        $comid  =  intval($_POST['comid']);
 
        $zphnetM  =  $this->MODEL('zphnet');
        $row      =  $zphnetM->getInfo(array('id'=>$zid));
 
        //招聘会进行中才保存
        if ($row['stime'] < 0 && $row['etime'] > 0){
 
            $data   =  array(
                'zid'    =>  $zid,
                'jobid'  =>  $jobid,
                'comid'  =>  $comid,
                'ctime'  =>  time()
            );
 
            if(!empty($_POST['uid']) && !empty($_POST['token'])){
 
                $member  =  $this->yzToken($_POST['uid'], $_POST['token']);
 
                $data['uid']       =  $member['uid'];
                $data['usertype']  =  $member['usertype'];
            }
 
            $zphnetM  =  $this->MODEL('zphnet');
            $zphnetM->addZphnetLook($data);
        }
        $this->render_json(0, 'ok');
    }
    //报名招聘会条件判断
    function ajaxZphnet_action(){
 
        $member  =  $this->yzToken($_POST['uid'], $_POST['token']);
 
        $data    =    array(
            'usertype'    =>    $member['usertype'],
            'uid'        =>    $member['uid'],
            'spid'        =>    $member['spid'],
            'did'        =>    $member['did'],
            'jobid'        =>    $_POST['jobid'],
            'zid'        =>    intval($_POST['zid'])
        );
        $zphnetM  =  $this->MODEL('zphnet');
        $arr      =  $zphnetM->ajaxZphnet($data);
 
        if (!empty($arr['msg'])){
            $arr['msg']  = strip_tags($arr['msg']);
        }
        $this->render_json(0, 'ok', $arr);
    }
    // 报名网络招聘会条件判断
    function ajaxComJob_action(){
        
        $return  =  array();
        $member  =  $this->yzToken($_POST['uid'], $_POST['token']);
        
        $zphnetM  =  $this->MODEL('zphnet');
        $comrow   =  $zphnetM->getZphnetCom(array('uid'=>$member['uid'],'zid'=>$_POST['id']));
        
        if (!empty($comrow)){
            
            $error    = 2;
            
            if($comrow['status']==0){
                
                $msg    = "您已报名,请等待审核!";
                
            }else if($comrow['status']==1){
                
                $msg    = "您已报名了,请不要重复报名!";
                
            }else if($comrow['status']==2){
                
                $msg    = "您的报名审核未通过,请联系管理员";
            }
            
        }else{
            
            $where    =    array(
                'uid'        =>    $member['uid'],
                'state'        =>    1,
                'status'    =>    0,
                'r_status'    =>    array('<>',2),
            );
            $jobM    =    $this->MODEL('job');
            $arr    =    $jobM->getList($where, array('field'=>'`id`,`name`'));
            $list    =    $arr['list'];
            
            if(!empty($list)){
                
                $return['joblist']  =  $list;
                
                $error  =  0;
                $msg    =  '';
                
            }else{
                
                $error    =  2;
                $msg    =  "您还没有发布职位,请先发布职位!";
            }
        }
        $this->render_json($error, $msg, $return);
    }
    /**
     * 检查企业参会情况
     */
    function isJoin_action(){
        
        $member  =  $this->yzToken($_POST['uid'], $_POST['token']);
        
        $zphnetM  =  $this->MODEL('zphnet');
        $row      =     $zphnetM->getZphnetCom(array('uid'=>$member['uid'],'zid'=>$_POST['zid']),array('field'=>'`status`'));
        
        if(!empty($row)){
            if ($row['status'] == 1){
                
                if ($_POST['type'] == 'spview'){
                    $trtcM   =  $this->MODEL('trtc');
                    $return  =  $trtcM->getTrcInfo(array('uid'=>$member['uid'], 'usertype'=>$member['usertype'], 'fuid'=>$_POST['fuid']), true, $_POST['provider']);
                }
                
                $return['error']  =  1;
                
            }elseif ($row['status'] == 2){
                $return['error']  =  2;
                $return['msg']  =  '参会报名审核未通过,请联系管理员';
            }else{
                $return['error']  =  3;
                $return['msg']  =  '参会报名审核中';
            }
        }else{
            $return['error']  =  4;
            $return['msg']  =  '您尚未参会,请先参会';
        }
        
        $this->render_json(0, 'ok', $return);
    }
}
?>