chengkun
2025-05-12 c49b17b9588306c14ad4b30e6a2c4b8644f3233b
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
<?php
 
class admin_lt_pic_controller extends adminCommon{
    function set_search()
    {
        $search_list[]  = array(
            'param'     => 'status',
            'name'      => '审核状态',
            'value'     => array(
                '0' => '已审核',
                '1' => '未审核'
            )
        );
 
        $this->yunset('search_list', $search_list);
    }
    /**
     * 会员-猎头-图片管理
     * 2019-06-03 hjy
     */
    public function index_action(){
        $this            ->    set_search();
 
        $ltWhereData                        =    array();
        $ltWhereData['photo_big']                =    array('<>', '');
 
        $keywordStr                            =    trim($_GET['keyword']);
        $typeStr                            =    intval($_GET['type']);
        if(!empty($keywordStr)){
            if($typeStr == 2){
                $ltWhereData['uid']    =    array('=', $keywordStr);
            }elseif($typeStr == 3){
                $ltWhereData['realname']    =    array('like', $keywordStr);
            }else{
                $ltWhereData['com_name']    =    array('like', $keywordStr);
            }
        }
 
        if(isset($_GET['status'])){
            
            $status                             =   intval($_GET['status']);
            
            $ltWhereData['photo_status']      =  $status;
            
            $urlarr['status']               =  $status;
        }
 
        $urlarr                                 =    $_GET;
        $urlarr['page']                            =    '{{page}}';
        $pageurl                                =    Url($_GET['m'], $urlarr, 'admin');
        //提取分页
        $pageM                                    =    $this  -> MODEL('page');
        $pages                                    =    $pageM -> pageList('lt_info', $ltWhereData, $pageurl, $_GET['page']);
        //分页数大于0的情况下 执行列表查询
        $List                                    =    array();
        $ltM                                    =    $this -> MODEL('lietou');
        if($pages['total'] > 0){
            //limit order 只有在列表查询时才需要
            $ltWhereData['orderby']                =    array('photo_status,desc','uid,desc');
            $ltWhereData['limit']                =    $pages['limit'];        
            $List                                =    $ltM -> getList($ltWhereData);
        }
 
 
        $this -> yunset('rows', $List);
        $this -> yuntpl(array('admin/admin_lt_pic'));
    }
    /**
     * @desc 猎头LOGO审核说明
     */
    function getStatusBody_action()
    {
        $lietouM   =   $this -> MODEL('lietou');
        
        $lietou    =   $lietouM -> getInfo(intval($_GET['uid']), array('field' => 'photo_statusbody'));
        
        echo trim($lietou['photo_statusbody']);die();
        
    }
    /**
     * @desc 猎头LOGO审核
     */
    function status_action()
    {
        $lietouM   =   $this->MODEL('lietou');
        
        //$status     =   intval($_POST['status']);
        
        //$statusbody =   trim($_POST['statusbody']);
        
       // $allid      =   @explode(',', $_POST['sid']);
 
        //$list    =   $lietouM -> getList(array('uid'=>array('in',pylode(',', $allid))), array('field' => 'uid'));
 
        $post                      =       array(
            
            'photo_statusbody'   =>      trim($_POST['statusbody']),
            
            'photo_status'       =>      intval($_POST['status'])
            
        );
        
        $return                   =          $lietouM -> statusLogo($_POST['sid'], array('post'=>$post));
 
        $this -> ACT_layer_msg($return['msg'], $return['errcode'], $_SERVER['HTTP_REFERER'],2,1);
 
    }
    /**
     * 会员-猎头-图片管理
     * 保存图片
     * 2019-06-03 hjy
     */
    public function uploadsave_action(){
        $_POST                                    =    $this -> post_trim($_POST);
        $id                                        =    intval($_POST['id']);
        $UploadM                                =    $this -> MODEL('upload');
 
        if(empty($_POST['update']) || $_POST['type'] != 'photo'){
            $this->ACT_layer_msg('参数错误!', 8, $_SERVER['HTTP_REFERER']);
        }
        $ltM                                    =    $this -> MODEL('lietou');
        $whereData                                =    array('uid' => array('=', $id));
        $upData                                    =    array();
        if($_FILES['file']['tmp_name']){
            $upArr    =  array(
                'file'  =>  $_FILES['file'],
                'dir'   =>  'lietou',
                'watermark' => 0
            );
 
            $uploadM  =  $this->MODEL('upload');
 
            $pic      =  $uploadM->newUpload($upArr);
            
            if (!empty($pic['msg'])){
 
                $this->ACT_layer_msg($pic['msg'],8);
 
            }elseif (!empty($pic['picurl'])){
 
                $pictures     =      $pic['picurl'];
            }
 
            $upData['photo_big']    =    $pictures;
            
        }else{
            $this -> ACT_layer_msg('请选择图片!', 8);
        }
 
        $nbid                                    =    $ltM -> upInfo($whereData, $upData);
        if(!empty($nbid)){
            $this -> ACT_layer_msg('猎头头像(ID:'.$id.')修改成功!', 9, $_SERVER['HTTP_REFERER'], 2, 1);
        }else{
            $this -> ACT_layer_msg('修改失败!', 8, $_SERVER['HTTP_REFERER']);
        }
 
    }
    /**
     * 会员-猎头-图片管理
     * 删除图片
     * 2019-06-03 hjy
     */
    public function del_action(){
        if(!empty($_GET['del'])){
            $this -> check_token();
            $layer_type                            =    1;
            $id                                    =    pylode(',', $_GET['del']);
        }else if(!empty($_GET['delid'])){
            $this -> check_token();
            $layer_type                            =    0;
            $id                                    =    $_GET['delid'];
        }
        if(empty($id)){
            $this -> layer_msg('请选择您要删除的图片!', 8, 1);
        }
 
        $ltM                                    =    $this -> MODEL('lietou');
        //修改相应图片字段
        $delid                                    =    $ltM -> upInfo(array('uid' => array('in', $id)), array('photo_big' => ''));
        if(!empty($delid)){
            $this -> layer_msg('猎头头像(ID:'.$id.')删除成功!', 9, $layer_type, $_SERVER['HTTP_REFERER']);
        }else{
            $this -> layer_msg('删除失败!', 8, $layer_type, $_SERVER['HTTP_REFERER']);
        }
 
    }
}
?>