chengkun
2025-05-22 1a8aea45ebb1582c9f65d9e8dcd520002f83ae12
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
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
<?php
 
class admin_gqinfo_pic_controller extends adminCommon{
 
    function set_search(){
       
        $search_list[]  = array("param"=> "status","name"=> '审核状态',"value" => array('1'=>'待审核','0' => '已审核','2' => '未通过'));
        
        $this->yunset("search_list", $search_list);
 
    }
    /**
     * 会员-供求-图片管理:个人头像(列表)
     */
    function index_action(){
 
        $this                            ->        set_search();
        
        $gqdemandM                        =          $this -> MODEL('gqdemand');
 
        $where['photo']                  =          array('<>','');
        
        if($_GET['keyword']){
            
            $keytype                      =       intval($_GET['type']);
            
            $keyword                      =       trim($_GET['keyword']);
            
            if ($keytype == 1){
                
                $where['name']          =          array('like',$keyword);
                
            }elseif ($keytype == 2){
                
                $where['uid']           =          array('=',$keyword);
            }
            
            $urlarr['keytype']               =          $keytype;
            
            $urlarr['keyword']            =          $keyword;
            
        }
        if(isset($_GET['status'])){
            
            $status                     =       intval($_GET['status']);
            
            $where['photo_status']      =          $status;
            
            $urlarr['status']           =          $status;
        }
        $urlarr                            =       $_GET;
        $urlarr['page']                    =        '{{page}}';
        
        $pageurl                        =         Url($_GET['m'],$urlarr,'admin');
        
        //提取分页
        $pageM                            =        $this  -> MODEL('page');
        
        $pages                            =        $pageM -> pageList('gq_info',$where,$pageurl,$_GET['page']);
        //分页数大于0的情况下 执行列表查询
        if($pages['total'] > 0){
            //limit order 只有在列表查询时才需要
            $where['orderby']            =        array('photo_status,desc','uid,desc');
            
            $where['limit']                =        $pages['limit'];
        
            $List                        =        $gqdemandM->getGqinfoList($where,array('field'=>'`photo`,`uid`,`photo_status`,`name`'));
            
            $this -> yunset('rows',$List);
            
        }
        
        $this->yuntpl(array('admin/admin_gqinfo_pic'));
 
    }
    /**
     * 会员-供求-图片管理:用户头像(获取审核说明)
     */
    function getStatusBody_action(){
        
        $gqdemandM     =  $this -> MODEL('gqdemand');
 
        $where['uid']  =  intval($_GET['uid']);
        
        $return         =  $gqdemandM -> getGqInfo($where,array('field'=>'`photo_statusbody`','type'=>1));
        
        echo trim($return['photo_statusbody']);die;
    }
    /**
     * 会员-个人-图片管理:个人头像(审核)
     */
    function status_action(){
        
        $gqdemandM                        =          $this -> MODEL('gqdemand');
        
        $uid                            =        @explode(',', $_POST['uid']);
        
 
        if($_POST['status']  ==""){
 
            $this->ACT_layer_msg("请选择审核状态",8);
 
        }
 
        if($uid){
 
            if(is_array($uid)){
 
                $where['uid']                =              array('in', pylode(',', $uid));
 
            }else{
 
                $where['uid']                =              intval($uid);
 
            }
            
            if($_POST['status']  ==2){
                
                //头像不通过审核
 
                $data                             =                array(
 
                    'photo'                         =>              '',
 
                    'photo_status'                 =>              intval($_POST['status']),
    
                    'photo_statusbody'              =>              $_POST['statusbody']
    
                );
 
            }else{
                //头像通过审核
 
                $data                             =                array(
 
                    'photo_status'                 =>              intval($_POST['status']),
    
                    'photo_statusbody'              =>              $_POST['statusbody']
    
    
                );
 
            }
            
            $return  =  $gqdemandM -> upGqInfoStatus($where,$data);
 
            $this -> ACT_layer_msg($return['msg'],$return['errcode'],$_SERVER['HTTP_REFERER'],2,1);
 
        }else{
 
            $this->ACT_layer_msg('非法操作!',8,$_SERVER['HTTP_REFERER']);
        }
    }
 
    
    /**
     * 会员-个人-图片管理:个人头像(修改)
     */
    function savePhoto_action(){
 
        $gqdemandM                        =          $this -> MODEL('gqdemand');
        
        $file                             =          $_FILES['file'];
        
        $where['uid']                    =        intval($_POST['id']);
 
        $data                            =        array(
 
            'file'                        =>        $file,
 
            'photo_status'                =>        0,
 
            'photo_statusbody'            =>        ''
        );
        
        $return   =  $gqdemandM -> upaddGqinfo($where,$data);
        
        $this -> ACT_layer_msg($return['msg'],$return['errcode'],$_SERVER['HTTP_REFERER'],2,1);
    }
 
    
    /**
     * 会员-个人-图片管理:个人头像(删除)
     */
    function delPhoto_action(){
 
        $gqdemandM                        =          $this -> MODEL('gqdemand');
        
        if ($_GET['del']){
            
            $this -> check_token();
            
            $uid                          =          intval($_GET['del']);
            
            $layertype                    =        0;
            
        }elseif ($_POST['del']){
            
            $uid                          =          $_POST['del'];
 
            $layertype                    =        1;
            
            
        }
        
        $where['uid']                    =              array('in', pylode(',', $uid));
 
        $data                            =                array(
 
            'photo'                         =>              '',
 
            'photo_status'                =>              1,
 
            'photo_statusbody'            =>              ''
 
 
        );
        
        $return   =  $gqdemandM -> upaddGqinfo($where,$data,1);
        
        $this->layer_msg($return['msg'],$return['errcode'],$layertype,$_SERVER['HTTP_REFERER']);
    }
 
}
?>