chengkun
2025-05-23 0d8e263c22903234efea68fd13a27d8b7b59aac1
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
<?php
 
class admin_userchange_controller extends adminCommon{     
    private function set_search(){
        $search_list[]  =  array('param'=>'sqtype','name'=>'申请方式','value'=>array('1'=>'用户申请','2'=>'管理员转换'));
        $search_list[]  =  array('param'=>'status','name'=>'审核状态','value'=>array('3'=>'待确认','1'=>'已同意','2'=>'已拒绝'));
        $search_list[]  =  array('param'=>'presusertype','name'=>'当前会员','value'=>array('1'=>'个人会员','2'=>'企业会员','3'=>'猎头会员','4'=>'培训会员'));
        $search_list[]  =  array('param'=>'applyusertype','name'=>'申请会员','value'=>array('1'=>'个人会员','2'=>'企业会员','3'=>'猎头会员','4'=>'培训会员'));
        $search_list[]  =  array('param'=>'applytime','name'=>'申请时间','value'=>array('1'=>'今天','3'=>'最近三天','7'=>'最近七天','15'=>'最近半月','30'=>'最近一个月'));
        $this->yunset('search_list',$search_list);
    }
    function index_action(){
        $this->set_search();
        if(trim($_GET['keyword'])){
            if($_GET['type']==1){
                
                $where['name']        =    array('like',trim($_GET['keyword']));
                
            }elseif($_GET['type']==2){
                $where['uid']            =    array('=',trim($_GET['keyword']));
            }
            $urlarr['keyword']            =    $_GET['keyword'];
            
            $urlarr['type']                =    $_GET['type'];
        }
        if($_GET['sqtype']){
            $sqtype                      =   intval($_GET['sqtype']);
            $where['type']                 =   $sqtype;
            $urlarr['status']            =   $sqtype;
        }
        if ($_GET['status']) {
            $status              =           intval($_GET['status']);
            $where['status']             =   $status == 3 ? 0 : $status;
            $urlarr['status']            =   $status;
        }
        if($_GET['id']){
            $id                            =    intval($_GET['id']);
            $where['id']                =    $id;
            $urlarr['id']                =    $id;
        }
        if($_GET['presusertype']){
            $presusertype                =    intval($_GET['presusertype']);
            $where['pres_usertype']        =    $presusertype;
            $urlarr['pres_usertype']    =    $presusertype;
        }
        if($_GET['applyusertype']){
            $applyusertype                =    intval($_GET['applyusertype']);
            $where['apply_usertype']    =    $applyusertype;
            $urlarr['apply_usertype']    =    $applyusertype;
        }
        $userinfoM    =    $this->MODEL('userinfo');
        $urlarr            =   $_GET;
        $urlarr['page']    =    '{{page}}';
        $pageurl        =    Url($_GET['m'],$urlarr,'admin');
        $pageM            =    $this  -> MODEL('page');
        $pages            =    $pageM -> pageList('user_change',$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('status,asc','apply_time,desc');
            }
            $where['limit']    =      $pages['limit'];
            $List            =    $userinfoM -> getUserChangeList($where,array('field'=>'`id`,`uid`,`name`,`pres_usertype`,`apply_usertype`,`apply_time`,`lastupdate`,`status`,`applybody`,`did`,`statusbody`,`type`'));
            $this -> yunset('rows',$List);
        }
        $cacheM    =    $this -> MODEL('cache');
        $domain    =    $cacheM    -> GetCache('domain');
        $this -> yunset('Dname', $domain['Dname']);
        $this->yuntpl(array('admin/admin_userchange'));
    }
    /**
     * 会员身份切换列表:获取拒绝、审核未通过原因
     */
    function lockinfo_action(){
        
        $userinfoM  =  $this -> MODEL('userinfo');
        
        $member     =  $userinfoM -> getUserChangeInfo(array('id'=> $_GET['id']),array('field'=>'statusbody'));
        
        echo trim($member['statusbody']);die;
    }
    /**
     * 申请列表(页面统计数量)
     */
    function memNum_action(){
        $MsgNum    =    $this->MODEL('msgNum');
        echo $MsgNum->memchangeNum();
    }
    function status_action(){
        $userinfoM            =            $this->MODEL('userinfo');
        $id                    =            $_POST['id'];
        $status                =            intval($_POST['status']);
 
        if(!$id){
            $this->ACT_layer_msg('请选择要审核的用户',8);
        }
        if($status==""){
            $this->ACT_layer_msg('请选择审核状态',8);
        }
        if($status==2){
            $state            =            1;
        }else{
            $state            =            0;
        }
 
        $data                =            array(
            'status'        =>            $status,
            'statusbody'    =>            $_POST['statusbody'],
            'lastupdate'    =>            time(),
            'state'            =>            $state
        );
 
        $id_arr             =             $id ? @explode(',',$id) : array();
            
        if(!empty($id_arr)){
 
            $return                =            $userinfoM->upAllUserChange($id_arr,$data,'5');
 
        }else{
            $moblie                =            $_POST['moblie'];
            //查询手机号码:判断当前用户是哪个类型呢?
            $uid                =            $_POST['uid'];
            
            $return                =            $userinfoM->upUserChange($id,$uid,$moblie,$data,'5');
        }
        
        $this->ACT_layer_msg($return['msg'],$return['errcode'],$_SERVER['HTTP_REFERER'],2,1);
 
    }
    /**
     * 切换身份: 删除
     */
    function del_action(){
        $userinfoM            =            $this->MODEL('userinfo');
        if ($_GET['del']){
            $this -> check_token();
            $id   =  intval($_GET['del']);
        }elseif ($_POST['del']){
            $id   =  $_POST['del'];
        }
        $return   =  $userinfoM -> delUserChange($id);
        
        $this -> layer_msg($return['msg'],$return['errcode'],$return['layertype'],$_SERVER['HTTP_REFERER']);
    }
 
}
?>