chengkun
2025-05-26 8f3df543230cd4403368b39b9bbe5726d11a0284
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
<?php
 
class index_controller extends common{
 
    function index_action(){
 
        $CacheM       =   $this -> MODEL('cache');
 
        $CacheList    =   $CacheM -> GetCache(array('city','com','hy','job'));
 
        $this         ->  yunset($CacheList);
 
        if($_GET['city']){//城市匹配
 
            $city                    =    explode("_",$_GET['city']);
 
            $_GET['provinceid']        =    $city[0];
            $_GET['cityid']            =    $city[1];
            $_GET['three_cityid']    =    $city[2];
        }
 
        if ($this->config['sy_web_city_one']) {
            $_GET['provinceid'] =     $this->config['sy_web_city_one'];
        }
        if ($this->config['sy_web_city_two']) {
            $_GET['cityid']     =     $this->config['sy_web_city_two'];
        }
 
        if($this->config['province']){
            $_GET['provinceid']     =     $this->config['province'];
        }
        if($this->config['cityid']){
            $_GET['cityid']         =     $this->config['cityid'];
        }
        if($this->config['three_cityid']){
            $_GET['three_cityid']    =     $this->config['three_cityid'];
        }
 
        $this->yunset(array('gettype' => $_SERVER['QUERY_STRING'], 'getinfo' => $_GET));
 
 
        $this->seo('spview');
        $this->yun_tpl(array('index'));
    }
 
    function show_action(){
 
        if($_GET['id']){
            
            $spviewM    =    $this->MODEL('spview');
            
            $userinfoM    =    $this->MODEL('userinfo');
            
            $spviewM -> upSpviewHits($_GET['id']);            
 
            $spview        =    $spviewM->getInfo(array('id'=>$_GET['id']));
            
            $this->yunset("spview",$spview);
            
            if(empty($spview)){
 
                $this->ACT_msg($this->config['sy_weburl'],"没有找到该视频面试!");
 
            }else {
                $look = isset($_GET['look']) && $_GET['look'] == 'admin' && !empty($_SESSION['auid']) ? 'admin' : '';
                if($spview['status']!=1 && $look != 'admin'){
                    $this->ACT_msg($this->config['sy_weburl'],"该视频面试尚未审核!");
                }
            }
 
            $comid                =    $spview['uid'];
            $CompanyM            =   $this -> MODEL('company');
            $company             =   $CompanyM -> getInfo($comid, array('logo' => '1'));
            
            if ($company['r_status'] == 0 || $company['r_status'] == 3) {
                $this->ACT_msg($this->config['sy_weburl'], '企业暂未通过审核!');
            } elseif ($company['r_status'] == 2 || $company['r_status'] == 4) {
                $this->ACT_msg($this->config['sy_weburl'], '企业已被锁定!');
            }
 
            $jobM                =   $this -> MODEL('job');
 
            $spjobs                =    $jobM -> getList(array('id'=>array('in',$spview['jobid']),'uid'=>$comid,'status'=>'0','state'=>'1','r_status'=>1));
 
            $spview_sub            =    $spviewM -> getSubinfo(array('sid'=>$_GET['id'],'uid'=>$this->uid), array('job'=>1));
 
            $stopTime            =    $spview['starttime'] - ($this->config['sy_spview_yytime'] * 3600);
            $this->yunset("stopTime",$stopTime);
            
            if($spview_sub){
                // 已预约
                if(time()>$spview['starttime']){
                    
                    $issub        =    2;
                    // 已面试
                    $mswhere        =    array(
                        'status'    =>    2,
                        'sid'        =>    $_GET['id']
                    );
                    
                    $msnum        =    $spviewM -> getSubNum($mswhere);
                    $this->yunset("msnum",$msnum);
                    
                }else{
                    
                    $issub        =    1;
                    // 未开始
                }
                
                $lineData        =    array(
                    'status'    =>    0,
                    'sid'        =>    $_GET['id'],
                    'rtime'        =>    array('>',0)
                );
                
                $linenum        =    $spviewM -> getSubNum($lineData);
                
                $this->yunset("linenum",$linenum);
                
                $this->yunset("subinfo",$spview_sub);
                
            }else{
                // 未预约
                if(time()<=$stopTime){
                    // 可以预约
                    $issub        =    3;
                    
                }elseif (time() <= $spview['starttime']){
                    // 停止预约,但未开始
                    $issub        =    4;
                    
                }else{
                    // 已开始
                    $issub        =    5;
                }
                $subnum    =    $spviewM -> getSubNum(array('sid'=>$_GET['id']));
                
                $this->yunset("subnum",$subnum);
            }
            
            if($this->uid && $this->usertype==1){
 
                $ResumeM    =   $this->MODEL('resume');
                $resumenum  =   $ResumeM->getExpectNum(array('uid'=>$this->uid,'status'=>1,'state'=>1,'r_status'=>1));
                $this->yunset('resumenum', $resumenum);
 
            }
 
            $this->yunset("issub",$issub);
            
            $week    =    $this->get_week($spview['starttime']);
            
            $this->yunset("week",$week);
            
            $this->yunset("comid",$comid);
 
            $this->yunset("com",$company);
            
            $this->yunset("spjobs",$spjobs['list']);
 
            $this->yunset(array("com_style"=>$this->config['sy_weburl']."/app/template/company/default/","comstyle"=>TPL_PATH."company/default/"));
 
            $data    =   array('company_name' =>  $company['name']);
            $this->data = $data;
        }
        
        $this->seo('spview_show');
        $this->yun_tpl(array('spview'));
 
    }
    /**
     * 个人有多简历,预约时要选择简历
     */
    function ajaxResume_action(){
        
        if(!$this->uid || !$this->username || $this->usertype != 1){
            
            $arr['msg']        =    '请登录个人用户!';
            $arr['login']    =    1;
        }else{
            
            $spviewM         =    $this->MODEL('spview');
            
            $sid            =    intval($_POST['sid']);
            
            $subNum            =    $spviewM -> getSubinfo(array('uid' => $this -> uid, 'sid' => $sid));
            
            
            if($subNum > 0){    //已投递过
                
                $arr['msg']    =    '您已预约过该视频面试!';
            }else{
                
                $ResumeM    =    $this -> MODEL('resume');
                
                $resumeList    =    $ResumeM -> getSimpleList(array('uid' => $this -> uid, 'r_status' => 1, 'state' => 1, 'orderby' => 'defaults, desc'), array('field' => '`id`,`name`,`defaults`'));
                
                if(!empty($resumeList)){
                    $data   =   '';
                    foreach($resumeList as $v){
                        
                        if($v['defaults'] == 1){
                            
                            $data.='<div class="job_prompt_sendresume_list job_prompt_sendresume_list_cur" id="resume_'.$v['id'].'" data_did="'.$v['id'].'" onclick="subviewclic('.$v['id'].');"><i class="job_prompt_sendresume_radio"></i><i class="job_prompt_sendresume_radio_q"></i>'.$v['name'].'(默认简历)</div>';
                            
                        }else{
                            
                            $data.='<div class="job_prompt_sendresume_list " id="resume_'.$v['id'].'" data_did="'.$v['id'].'" onclick="subviewclic('.$v['id'].');"><i class="job_prompt_sendresume_radio"></i><i class="job_prompt_sendresume_radio_q"></i>'.$v['name'].'</div>';
                            
                        }
                    }
                    
                    $arr['status']        =    1;
                    $arr['resumeList']    =    $data;
                    
                }else{
                    
                    $resuemNum        =    $ResumeM -> getExpectNum(array('uid' => $this -> uid));
                    
                    if(intval($resuemNum) > 0){
                        
                        $arr['msg']    =    '您的简历尚未完成审核,请联系管理员加快审核进度!';
                    }else{
                        $arr['alert']    =    1;
                        $arr['msg']        =    '您还没有合适的简历,是否先添加简历?';
                    }
                    
                }
                
            }
        }
        echo json_encode($arr);die;
    }
    //视频面试预约
    function viewSub_action(){
        
        if(!empty($_POST['jobid'])){
            $spviewM    =    $this->MODEL('spview');
            
            $subData    =    array(
                'uid'        =>  $this->uid,
                'usertype'    =>  $this->usertype,
                'sid'        =>  $_POST['sid'],
                'did'        =>    $this->did,
                'jobid'        =>    $_POST['jobid'],
                'comid'        =>    $_POST['comid'],
                'eid'        =>    intval($_POST['eid']),
                'port'        =>    1
            );
            
            $return        =    $spviewM->viewSub($subData);
            
        }else{
            
            $return['errcode']    =    1;
            
            $return['msg']        =    '请选择职位';
        }
        
        echo json_encode($return);die;
        
    }
 
    function get_week($date){
        //强制转换日期格式
        $date_str=date('Y-m-d',$date);
        //封装成数组
        $arr=explode("-", $date_str);
        //参数赋值
        //年
        $year=$arr[0];
        //月,输出2位整型,不够2位右对齐
        $month=sprintf('%02d',$arr[1]);
        //日,输出2位整型,不够2位右对齐
        $day=sprintf('%02d',$arr[2]);
        //时分秒默认赋值为0;
        $hour = $minute = $second = 0;
        //转换成时间戳
        $strap = mktime($hour,$minute,$second,$month,$day,$year);
        //获取数字型星期几
        $number_wk=date("w",$strap);
        //自定义星期数组
        $weekArr=array("星期日","星期一","星期二","星期三","星期四","星期五","星期六");
        //获取数字对应的星期
        return $weekArr[$number_wk];
    }
    // 进入面试房间,变为待面试
    function goRoom_action(){
        
        $where  =  array(
            'uid'  =>  $this->uid,
            'sid'  =>  $_POST['sid']
        );
        
        $spviewM  =  $this->MODEL('spview');
        
        $row  =  $spviewM->getSubinfo($where, array('field'=>'`rtime`'));
        
        if (empty($row['rtime'])){
            
            $spviewM->updateSubcribe($where, array('rtime'=>time()));
        }
    }
}
?>