chengkun
2025-05-23 a6f7b382623096b6a00924f418447cf5204e825e
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
<?php
 
class admin_member_logout_controller extends adminCommon{     
    function index_action()
    {
        if ($_GET['status']){
            $where['status']  =  intval($_GET['status']);
        }
        if(trim($_GET['keyword'])){
            if($_GET['type']==1){
                
                $where['username']        =    array('like',trim($_GET['keyword']));
                
            }elseif($_GET['type']==2){
                
                $where['moblie']        =    array('like',trim($_GET['keyword']));
                
            }elseif($_GET['type']==3){
                
                $where['uid']            =    array('=',trim($_GET['keyword']));
                
            }
            $urlarr['keyword']            =    $_GET['keyword'];
            
            $urlarr['type']                =    $_GET['type'];
        }
        $where['orderby']  =  array('id,desc');
        $urlarr            =   $_GET;
        $urlarr['page']    =    '{{page}}';
        
        $pageurl        =    Url($_GET['m'],$urlarr,'admin');
        
        $pageM            =    $this  -> MODEL('page');
        
        $pages            =    $pageM -> pageList('member_logout',$where,$pageurl,$_GET['page']);
        
        if($pages['total'] > 0){
            
            $where['limit']    =      $pages['limit'];
            
            $logoutM  =  $this->MODEL('logout');
            $List     =  $logoutM -> getList($where);
            
            if ($List) {
                $uIds = [];
                foreach ($List as $key => $value) {
                    $uIds[] = $value['uid'];
                }
 
                $userType = [
                    1 => '个人',
                    2 => '企业',
                    3 => '猎头',
                    4 => '培训',
                ];
                // 查询会员对应角色
                $userInfoModel = $this->MODEL('userinfo');
                $userInfoM    =    $this->MODEL('userinfo');
                $whereData = ['uid'=> ['in',implode(',', $uIds)]];
                $userList = $userInfoModel->getList($whereData, ['field' => 'usertype,uid']);
                $userListNew = [];
                foreach ($userList as $key => $value) {
                    $userListNew[$value['uid']] = $value['usertype'];
                }
                
                foreach ($List as $key => $value) {
                    $List[$key]['usertype_name'] = isset($userType[$userListNew[$value['uid']]])? $userType[$userListNew[$value['uid']]] : '未知';
                }
            }
            $this -> yunset('rows',$List);
        }
        $statusArr        =  array('1'=>'未处理','2'=>'已处理');
        $search_list[]  =  array('param'=>'status','name'=>'处理状态','value'=>$statusArr);
        $this->yunset('search_list',$search_list);
        
        $this->yuntpl(array('admin/admin_member_logout'));
    }
    /**
     * 注销账号申请审核
     */
    function status_action()
    {
        $id  =  intval($_POST['id']);
        
        $logoutM  =  $this->MODEL('logout');
        $return   =  $logoutM->status(array('id'=>$id));
        
        $this->layer_msg($return['msg'],$return['errcode']);
    }
    /**
     * 注销账号申请删除
     */
    function del_action(){
        
        $whereData    =    array();
        if(isset($_GET['id'])){
            $this->check_token();
            $delid  =  intval($_GET['id']);
        }
        if($_POST['del']){
            
            $delid  =  $_POST['del'];
        }
        $logoutM  =  $this->MODEL('logout');
        $return      =     $logoutM->del($delid);
        
        $this->layer_msg($return['msg'],$return['errcode'],$return['layertype'],$_SERVER['HTTP_REFERER']);
    }
}
?>