chengkun
2025-04-30 6ab292fb7415be124651e312ec4f21c594568f17
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
<?php
 
class xjhlive_controller extends user_controller{
    //宣讲会记录
    function index_action(){
 
        $xjhM            =    $this -> MODEL('xjhlive');
        $where['uid']        =    $this->member['uid'];
        $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                =    $xjhM -> getyyList($where);
 
        $data    =    array();
 
        if(is_array($rows) && !empty($rows)){
            
            $error    =    0;
        }else{
            $error    =    2;
        }
        $data['list']    =    count($rows) ? $rows : array();
        $this->render_json($error,'',$data);
 
    }
    //删除宣讲会记录
    function delXjhLiveyy_action(){
 
        if($_POST['id']){
            
            $id            =    intval($_POST['id']);
            
            $xjhM        =    $this -> MODEL('xjhlive');
 
            $return        =    $xjhM -> delyy($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));
        
        $return   =  array(
            'room' => array(
                'subnum'   =>  $subnum,
                'linenum'  =>  $linenum,
                'msnum'    =>  $msnum
            ),
        );
        
        $this->render_json(0, 'ok', $return);
    }
}