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
<?php
 
class spview_controller extends user_controller{
    //视频面试记录
    function index_action(){
 
        $spviewM            =    $this -> MODEL('spview');
        $where['uid']        =    $this->member['uid'];
        $total = $spviewM->getSubNum($where);
        $page                =    $_POST['page'];
        
        $limit                =    $_POST['limit'] ? $_POST['limit'] : 10;
        if($page){
            $pagenav        =    ($page-1)*$limit;
            $where['limit']    =    array($pagenav,$limit);
        }else{
            $where['limit']    =    $limit;
        }         
        
        $where['orderby']    =    'ctime,desc';
        $rows                =    $spviewM -> getSublist($where, array('job'=>1,'room'=>1));
 
        $data    =    array();
 
        if(is_array($rows) && !empty($rows)){
            
            $error    =    0;
        }else{
            $error    =    2;
        }
        $data['list']    =    count($rows) ? $rows : array();
        $this->render_json($error,'',$data,$total);
 
    }
    //删除视频面试记录
    function delSub_action(){
 
        if($_POST['id']){
            
            $id            =    intval($_POST['id']);
            
            $spviewM    =    $this -> MODEL('spview');
 
            $return        =    $spviewM -> delSub($id, array('uid'=>$this->member['uid'],'usertype'=>$this->member['usertype']));
 
            
            $error         =     $return['errcode']=='9' ? 1 : 2;
            $msg        =    $return['msg'];
        }else{
            $error         =     2;
            $msg        =    '数据异常,请重试';
        }
 
        $this->render_json($error,$msg);
 
    }
    //进入视频面试房间
    function sproom_action(){
        
        $id       =  $_POST['sid'];
        $spviewM  =  $this->MODEL('spview');
        $subnum   =  $spviewM->getSubNum(array('sid'=>$id));
        $linenum  =  $spviewM->getSubNum(array('sid'=>$id,'status'=>0,'rtime'=>array('>',0)));
        $msnum    =  $spviewM->getSubNum(array('sid'=>$id,'status'=>2));
        
        $row      =  $spviewM->getSubinfo(array('sid'=>$id,'uid'=>$this->member['uid']));
        
        $trtcM  =  $this->MODEL('trtc');
        $trtc   =  $trtcM->getUserSig(array('uid'=>$this->member['uid'], 'fuid'=>$row['comid'],'usertype'=>1));
        
        $return   =  array(
            'room' => array(
                'subnum'   =>  $subnum,
                'linenum'  =>  $linenum,
                'msnum'    =>  $msnum,
            ),
            'status'  =>  $row['status'],
            'roomId'  =>  $trtc['roomid']
        );
        
        $this->render_json(0, 'ok', $return);
    }
}