chengkun
2025-04-27 1158f672536ba406cc4bef68aed19a6c05483ab4
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
<?php
 
class admin_privacy_log_controller extends adminCommon{
 
    function set_search(){
    
        $search_list[]    =    array("param"=>"state","name"=>'绑定状态',"value"=>array("1"=>"绑定成功","2"=>"绑定失败"));
        
        $lo_time        =    array('1'=>'今天','3'=>'最近三天','7'=>'最近七天','15'=>'最近半月','30'=>'最近一个月');
        
        $search_list[]    =    array("param"=>"time","name"=>'时间',"value"=>$lo_time);
 
        
        $this->yunset(array('search_list' => $search_list, 'ports' => $ports));
        
    }
    
    function index_action()
    {
 
        $this->set_search();        
 
        $mobliemsgM    =    $this->MODEL('privacy');
        
        if(trim($_GET['keyword'])){
            
            $_GET['keyword']    =    trim($_GET['keyword']);
 
            if ($_GET['type']=='1'){
                
                $where['eid']    =    array('=',$_GET['keyword']);
                
            }else if($_GET['type']=='2'){
                
                $where['comid']    =    array('=',$_GET['keyword']);
                 
            }else if($_GET['type']=='3'){
                
                $where['bindnumber']    =    array('like',$_GET['keyword']);
                 
            }else if($_GET['type']=='4'){
                
                $where['middlenumber']    =    array('like',$_GET['keyword']);
                 
            }else if($_GET['type']=='5'){
                
                $where['result']    =    array('like',$_GET['keyword']);
                 
            }else if($_GET['type']=='6'){
                
                $where['message']    =    array('like',$_GET['keyword']);
                 
            }
            
            $urlarr['type']        =    $_GET['type'];
            
            $urlarr['keyword']    =    $_GET['keyword'];
        }
 
        if(($_GET['date']) && $_GET['time']<1){
            
            $times                    =    @explode('~',$_GET['date']);
            
            $where['ctime'][0]        =    array('>=',strtotime($times[0]." 00:00:00"));
            
            $where['ctime'][1]        =    array('<',strtotime($times[1]." 23:59:59"));
            
            $urlarr['date']            =    $_GET['date'];
        }
 
        if($_GET['state']){
            
            if($_GET['state'] == '1'){
                $where['result']    =    1;
            }else{
                $where['result']    =    array('>',1);
            }
            
            $urlarr['state']            =    $_GET['state'];
        }
            
 
        if($_GET['time']){
            
            if($_GET['time']=='1'){
                
                $where['ctime'][2]        =    array('>',strtotime(date("Y-m-d 00:00:00")));
            }else{
                
                $where['ctime'][3]        =    array('>',strtotime('-'.$_GET['time'].'day'));
            }
            unset($_GET['sdate']);
            unset($_GET['edate']); 
            
            $urlarr['time']    =    $_GET['time'];
        }
 
        
        if($_GET['order']=="asc"){
            
            $this->yunset("order","desc");
            
        }else{
            
            $this->yunset("order","asc");
            
        }
        
        //分页链接
        $urlarr            =   $_GET;
        $urlarr['page']    =    '{{page}}';
        $urlarr['c']    =    $_GET['c']; 
        $pageurl        =    Url($_GET['m'],$urlarr,'admin');
        
        //提取分页
        $pageM            =    $this  -> MODEL('page');
        $pages            =    $pageM -> pageList('privacy_log',$where,$pageurl,$_GET['page']);
        
        //分页数大于0的情况下 执行列表查询
        if($pages['total'] > 0){
            
            //limit order 只有在列表查询时才需要
            
            if($_GET['order']){
            
                if($_GET['order']=="desc"){
                    
                    $where['orderby']    =    $_GET['t'].',desc';
                    
                }else{
                    
                    $where['orderby']    =    $_GET['t'].',asc';
                    
                }
                
            }else{
                
                $where['orderby']        =    'id,desc';
        
            }
            
            $where['limit']            =    $pages['limit'];
            
            $urlarr['order']        =    $_GET['order'];
                
            $urlarr['t']            =    $_GET['t'];
            
            $List    =    $mobliemsgM -> getList($where);
            
            $this->yunset("rows",$List['list']);
        }
        
        
        
        $this->yunset("get_type", $_GET);
        
        $this->yuntpl(array('admin/admin_privacylog'));
        
    }
    function del_action(){
 
        $mobliemsgM    =    $this->MODEL('mobliemsg');
        
        if(is_array($_POST['del'])){
            
            $where['id']    =    array('in',pylode(',',$_POST['del']));
            
            $del            =    $mobliemsgM->delMoblieMsg($where,array('type'=>'all'));
            
            $layer_type        =    1;
            
            $delid            =    pylode(',',$_POST['del']);
            
        }else{
            
            $this->check_token();
            
            $where['id']    =    (int)$_GET['id'];
            
            $del            =    $mobliemsgM->delMoblieMsg($where,array('type'=>'one'));
            
            $layer_type        =    0;
            
            $delid            =    (int)$_GET['id'];
        }
    
        if(!$delid){
            
            $this->layer_msg('请选择要删除的内容!',8);
        
        }
        
        $del?$this->layer_msg('隐私号日志记录(ID:'.$delid.')删除成功!',9,$layer_type,$_SERVER['HTTP_REFERER']):$this->layer_msg('删除失败!',8,$layer_type,$_SERVER['HTTP_REFERER']);
    
    }    
    
}
 
?>