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
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
<?php
 
class subscribe_controller extends adminCommon{
    function set_search(){
 
        $search_list[]            =        array("param"=>"type","name"=>'订阅类型',"value"=>array("1"=>"订阅职位","2"=>"订阅简历"));
        
        $search_list[]            =        array("param"=>"state","name"=>'状态',"value"=>array("1"=>"已认证","2"=>"未认证"));
 
        $search_list[]            =        array("param"=>"end","name"=>'订阅时间',"value"=>array('1'=>'今天','3'=>'最近三天','7'=>'最近七天','15'=>'最近半月','30'=>'最近一个月'));
        
        $this->yunset("search_list",$search_list);
 
    }
    function index_action(){
 
        $this->set_search();
 
        $SubscribeM                            =            $this->MODEL('subscribe');
 
        if($_GET['end']){
            if($_GET['end']=='1'){
 
                $where['ctime']                  =              array('>=',strtotime('today'));
            
            }else{
 
                $where['ctime']                  =              array('>',strtotime('-'.intval($_GET['end']).' day'));
 
            }
            
            $urlarr['end']=$_GET['end'];
        }
 
        if($_GET['type']){ 
 
            $type                            =            intval($_GET['type']);
 
            $where['type']                    =            $type;            
 
            $urlarr['type']                    =            $type;
        }
        if($_GET['state']){
 
            $state                            =            intval($_GET['state']);
 
            $where['status']                =            $state    ==    2    ?    0    :    $state;
 
            $urlarr['state']                =            $state;
        
        }
        if($_GET['keyword']){
 
            $keyword                          =           trim($_GET['keyword']);
 
            $where['email']                  =              array('like',$keyword);
 
        }                
        $urlarr                                =           $_GET;
        $urlarr['page']                            =            '{{page}}';
        
        $pageurl                              =            Url($_GET['m'],$urlarr,'admin');
 
        //提取分页
        $pageM                                  =            $this  -> MODEL('page');
 
        $pages                                  =            $pageM -> pageList('subscribe',$where,$pageurl,$_GET['page']);
        
        if($pages['total']>0){
 
            if($_GET['order']){
 
                $where['orderby']            =            $_GET['t'].','.$_GET['order'];
 
                $urlarr['order']            =            $_GET['order'];
 
                $urlarr['t']                =            $_GET['t'];
 
            }else{
 
                $where['orderby']            =              array('ctime,desc');
 
            }
            
            $where['limit']                    =            $pages['limit'];
        
            $rows                            =            $SubscribeM->getList($where);
 
        }
        
        $this->yunset("rows",$rows);
 
        $this->yuntpl(array('admin/subscribe_list'));
 
    }
 
    function del_action(){
 
        $this->check_token();
 
        $SubscribeM                            =            $this->MODEL('subscribe');
 
        $del                                =            $_GET['del'];
 
        $addArr                                =            $SubscribeM -> del($del);
        
        $this   ->  layer_msg( $addArr['msg'],$addArr['errcode'],$addArr['layertype'],$_SERVER['HTTP_REFERER'],2,1);
 
    }
}
 
?>