chengkun
2025-05-26 8f3df543230cd4403368b39b9bbe5726d11a0284
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
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
<?php
 
class admin_hotjob_controller extends adminCommon{
    
     function set_search(){
         
        $ratingM = $this->MODEL('rating');
 
        $rating = $ratingM->getList(array( 'category' => '1', 'orderby' => 'sort,asc' ), array( 'field' => '`id`,`name`' ));
        
        if (! empty($rating)) {
            foreach ($rating as $k => $v) {
                $ratingarr[$v['id']] = $v['name'];
            }
        }
 
        $edtime = array(
            '1' => '7天内',
            '2' => '一个月内',
            '3' => '半年内',
            '4' => '一年内',
            '5' => '已到期'
        );
        
        $search_list[] = array(
            "param" => "rating",
            "name" => '会员等级',
            "value" => $ratingarr
        );
        
        $search_list[] = array(
            "param" => "time",
            "name" => '到期时间',
            "value" => $edtime
        );
        
        $this->yunset("search_list", $search_list);
    }
    
    function index_action(){
        
        $ComM          =   $this -> MODEL('company');
        
        $typeStr       =   intval($_GET['ctype']);
        
        $keywordStr    =   trim($_GET['keyword']);
        
        if (!empty($keywordStr)){
            
            if($typeStr == 1){
                
                $where['username'] =   array('like', $keywordStr);
                
            }else if($typeStr == 2){
                
                $where['beizhu']   =   array('like', $keywordStr);
                
            }
            
            $urlarr['ctype']       =    $typeStr;
            
            $urlarr['keyword']     =    $keywordStr;
        }
        
        if($_GET['rating']){
            
            $where['rating_id']    =   intval($_GET['rating']);
            
            $urlarr['rating']      =   intval($_GET['rating']);
            
        }
        
        if($_GET['time']){
            
            if ($_GET['time'] == '1') {
                $num = "+7 day"; // 7天
            } elseif ($_GET['time'] == '2') {
                $num = "+1 month"; // 一个月
            } elseif ($_GET['time'] == '3') {
                $num = "+6 month"; // 半年
            } elseif ($_GET['time'] == '4') {
                $num = "+1 year"; // 一年
            }
                    
            if($_GET['time']=='5'){
                
                $where['time_end']  =   array('<', time());
                
             }else{
                 $where['PHPYUNBTWSTART']    =   '';
                 
                 $where['time_end'][]    =   array('>', time());
                 $where['time_end'][]    =   array('<', strtotime($num));
                 
                 $where['PHPYUNBTWEND']    =   '';
            }
            
            $urlarr['time']  =   $_GET['time'];
            
        }
        $urlarr            =   $_GET;
        $urlarr['page']    =    '{{page}}';
        
        $pageurl        =    Url($_GET['m'], $urlarr, 'admin');
        
        //提取分页
        $pageM            =    $this  -> MODEL('page');
        
        $pages            =    $pageM -> pageList('hotjob', $where, $pageurl, $_GET['page']);
        
        //分页数大于0的情况下 执行列表查询
        if($pages['total'] > 0){
            
            //limit order 只有在列表查询时才需要
            if($_GET['order']){
                
                $where['orderby']        =    $_GET['t'].','.$_GET['order'];
                $urlarr['order']        =    $_GET['order'];
                $urlarr['t']            =    $_GET['t'];
                
            }else{
                
                $where['orderby']        =    array('time_start,desc');
                
            }
            
            $where['limit']                =    $pages['limit'];
            
            $rows     =   $ComM -> getHotJobList($where, array('utype'=>'admin'));
             
            $this -> yunset(array('rows'=>$rows));
            
        }
         
          $this->set_search();
        $this->yunset("rows",$rows);
        $this->yuntpl(array('admin/admin_hotjob'));
    }
    
    /**
     * @desc 后台  企业  名企设置/修改弹出
     */
    function hotjobinfo_action(){
        
        $ComM      =   $this -> MODEL('company');
        
        $id        =   intval($_GET['id']);
        $uid       =   intval($_GET['uid']);
        
        if(!empty($id)){
            
            $hotjob   =   $ComM -> getHotJob(array('uid'=>$id));
            
        }else if(!empty($uid)){
            
            $statisM  =   $this -> MODEL('statis');
            $statis   =   $statisM -> getInfo($uid, array('usertype'=>'2','field'=>'`rating` as `rating_id`,`rating_name` as `rating`'));
            $company  =   $ComM -> getInfo($uid,array('logo'=>1,'utype'=>'admin','field'=>'`name` as `username`, `uid`,`logo`'));
 
            $company['hot_pic']   =   $company['logo'];
            unset($company['logo']);
             
            $hotjob   =   array_merge($statis, $company);
            
             $hotjob['time_start']=time();
        }
         $this->yunset("hotjob",$hotjob);
        
        $this->yuntpl(array('admin/admin_hotjob_info'));
    }
    
    /**
     * @desc 取消(删除)名企招聘
     */
    function del_action(){
 
        $this->check_token();
        
        if (is_array($_GET['del'])){
            
            $layer_type    =   1;
            $uid           =   $_GET['del'];
            
        }elseif ($_GET['del']){
          
            $layer_type    =   0;
            $uid           =   intval($_GET['del']);
            
        }
        
        $ComM      =   $this -> MODEL('company');
        
        $return    =   $ComM -> delHotJob($uid);
        
        $return ? $this->layer_msg('名企(ID:'.pylode(',', $uid).')删除成功!',9,$layer_type,$_SERVER['HTTP_REFERER']) : $this->layer_msg('删除失败!',8,0,$_SERVER['HTTP_REFERER']);
        
    }
    
    /**
     * @desc 设置/修改名企 
     */
    function save_action(){
         
        
        
        if($_FILES['file']['tmp_name']!="" && is_uploaded_file($_FILES['file']['tmp_name'])){
            
             $upArr    =  array(
                'file'  =>  $_FILES['file'],
                'dir'   =>  'hotpic'
            );
 
            $uploadM  =  $this->MODEL('upload');
 
            $picr      =  $uploadM->newUpload($upArr);
            
            if (!empty($picr['msg'])){
 
                $this->ACT_layer_msg($picr['msg'],8);
 
            }elseif (!empty($picr['picurl'])){
 
                $pic     =      $picr['picurl'];
            }
             
            
         }
          
        $ComM     =   $this -> MODEL('company');
        
        $hotJob   =   $ComM -> getHotJob(array('uid' => $_POST['uid']));
        
        if(!$hotJob){
            
            $com      =   $ComM -> getInfo(intval($_POST['uid']),array('field'=>'`logo`,`did`','logo'=>1));
            
            $hotJob['hot_pic']    =    $com['logo_n'];
            $hotJob['did']        =    $com['did'];
        }
    
        $value    =   array(
            'uid'             =>  intval($_POST['uid']),
            'username'        =>  trim($_POST['username']),
            'rating'          =>  trim($_POST['rating']),
            'hot_pic'         =>  trim($pic)?trim($pic):$hotJob['hot_pic'],
            'service_price'   =>  intval($_POST['service_price']),
            'time_start'      =>  strtotime($_POST['time_start']),
            'time_end'        =>  strtotime($_POST['time_end']),
            'sort'            =>  intval($_POST['sort']),
            'beizhu'          =>  trim($_POST['beizhu']),
            'rating_id'       =>  intval($_POST['rating_id'])
        );
 
        if($_POST['hotad']){
            
            if (empty($hotJob['hot_pic']) && $_FILES['file']['tmp_name']==''){
                
                $this  ->  ACT_layer_msg('请上传企业展示LOGO',8,'index.php?m=admin_company',2,1);
            }
            
            $value['did'] =      intval($hotJob['did']);
            
            $arr          =   $ComM -> addHotJob($value);
            
        }elseif($_POST['hotup']){
 
            $arr  =   $ComM -> upHotJob($_POST['uid'], $value);  
        }
        
        $this  ->  ACT_layer_msg( $arr['msg'],$arr['errcode'],'index.php?m=admin_hotjob',2,1);
    }
 
    function hotNum_action(){
        
        $MsgNum=$this->MODEL('msgNum');
        
        echo $MsgNum->hotNum();
        
    }
    
}
?>