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
<?php
 
class xjh_controller extends zphnetv_controller{
    /**
     * 直播开启、关闭通知,修改状态
     */
    function livetz_action(){
        
        $post  =  str_replace('“','"',stripslashes($_POST['postdata']));
        
        $patterns     = array("{", "}");
        $replacements = array("{", "}");
        
        $post  =  str_replace($patterns,$replacements,$post);
        $post  =  json_decode($post,true);
        
        if ($_POST['appKey']  ==  $this->config['sy_xjhlive_appkey']){
            
            $xjhM  =  $this->MODEL('xjhlive');
            
            $data  =  array();
            
            if (isset($post['livestatus'])){
                // 直播状态
                $data['livestatus']  =  $post['livestatus'];
                
                if ($post['livestatus'] == 2){
                    
                    $data['recordurl']  =  $post['recordurl'];
                    
                    $info    =    $xjhM->getInfo(array('id'=>$post['xid']), array('field'=>'`caster`'));
                    if ($info['caster'] == 2){
                        
                        $data['caster']  =  1;
                    }
                }
            }
            $nid  =  $xjhM->upXjh(array('id'=>$post['xid']), $data);
        }
        
        $error  =  isset($nid) ? 0: 1;
        
        $this -> render_json($error, 'ok');
    }
    /**
     * 超过30分钟未直播,关闭导播台通知,修改状态
     */
    function castertz_action(){
        
        $post  =  str_replace('“','"',stripslashes($_POST['postdata']));
        
        $patterns     = array("{", "}");
        $replacements = array("{", "}");
        
        $post  =  str_replace($patterns,$replacements,$post);
        $post  =  json_decode($post,true);
        
        if ($_POST['appKey']  ==  $this->config['sy_xjhlive_appkey']){
            
            $xjhM  =  $this->MODEL('xjhlive');
            
            $data  =  array(
                'caster' => $post['state']
            );
            
            $nid   =  $xjhM->upXjh(array('id'=>$post['xid']), $data);
        }
        
        $error  =  isset($nid) ? 0: 1;
        
        $this -> render_json($error, 'ok');
    }
}
?>