chengkun
2025-04-27 ecc546d7df6ad021bfbc531674b10c2ffd224637
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
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
<?php
 
 
class admin_gqtask_controller extends adminCommon{
 
    private  function set_search(){
 
        $search_list[]              =           array('param' => 'status',   'name'=>'审核状态', 'value' =>  array('3'=>'待审核','1'=>'已审核','2'=>'未通过'));
           
        $search_list[]              =           array('param' => 'state',  'name'=>'招聘状态', 'value' =>  array('1'=>'招聘中','2'=>'已过期'));
        
        $search_list[]              =           array('param' => 'ctime',   'name'=>'发布时间', 'value' =>  array('1'=>'今天','3'=>'最近三天','7'=>'最近七天','15'=>'最近半月','30'=>'最近一个月'));
        
        $this->yunset("search_list", $search_list);
    }
    
    /**
     * @desc 后台供发布求任务 -- 浏览记录
     */
 
    function index_action(){
 
        $this->set_search();
       
 
        $gqdemandM                        =               $this -> MODEL('gqdemand');
         //查询状态
        
        if($_GET['status']){
            
            $status                     =            intval($_GET['status']);
            
            if($status == 3){
 
                $where['status']      =            '0';
                
            }elseif($status == 2){
                
               $where['status']       =             '2';
                 
            }elseif($status==1){
                
                $where['status']      =             '1';
                 
            }
            
            $urlarr['status']           =               $status;
        }
        //招聘状态
        
        if($_GET['state']){
            
            $state                      =               intval($_GET['state']);
            
           if($state    ==      1){
 
                $where['etime']         =               array('>',time());
 
           }else{
 
                 $where['etime']        =               array('<',time());
 
 
           }
            
            $urlarr['state']            =               $state;
        }
        
        
        //查询时间
        if ($_GET['ctime']) {
            
            $ctime                      =               intval($_GET['ctime']);
            
            if($ctime == 1){
            
                $where['ctime']         =               array('>',  strtotime('today'));
            
            }else {
                
                $where['ctime']         =               array('>', strtotime('-'.$ctime.' day'));    
                
            }
            
            $urlarr['ctime']            =               $ctime;
            
        }
        //根据条件查询
      
        $typeStr                        =               intval($_GET['type']);
 
        $keywordStr                     =               trim($_GET['keyword']);
        
        if (!empty($keywordStr)) {
            
            if ($typeStr == 2) {
                
                $mwhere['name']          =              array('like',$keywordStr);
 
                $gqrows                  =              $gqdemandM->getGqinfoList($mwhere,array('field'=>'`uid`','type'=>1));
 
                foreach($gqrows as $v){
                    
                    $gquids[]             =                $v['uid'];
                    
                }
                
                $where['uid']            =              array('in',pylode(',',$gquids));
 
            } else{
                $where['name']           =              array('like',$keywordStr);
                
                 
            }
            
            $urlarr['type']              =              $typeStr;
 
            $urlarr['keyword']           =              $keywordStr;
        }
     
        //分页链接
        $urlarr                             =              $_GET;
        $urlarr['page']                     =                '{{page}}';
        
        $pageurl                         =                Url($_GET['m'],$urlarr,'admin');
        
        //提取分页
        $pageM                             =                $this  -> MODEL('page');
      
        $pages                             =                $pageM -> pageList('gq_task',$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('status,asc','id,desc');   
            }
           
            $where['limit']                =                $pages['limit'];
           
            $rows                       =               $gqdemandM->getGqtaskList($where);
 
            $this -> yunset('rows',$rows);
            
        }
        
        $this->yuntpl(array('admin/admin_gqtask_list'));
        
    }
 
    /**
     * @desc  删除供求发布记录
     */
    function delgqtask_action(){
        
        $gqdemandM                        =                  $this -> MODEL('gqdemand');
 
        if(is_array($_GET['del'])){
            
            $id                         =               $_GET['del'];
            
        }else{
            
            $id                         =               intval($_GET['id']);
            
        }
 
        $arr                            =               $gqdemandM -> deltask($id,array('utype'=>'admin'));
        
        $this ->  layer_msg($arr['msg'], $arr['errcode'], $arr['layertype'],$_SERVER['HTTP_REFERER']);
        
    }
     //详情页面
     public function details_action(){
 
        $gqdemandM                    =                  $this -> MODEL('gqdemand');
 
        $id                         =               intval($_GET['id']);
 
        $where['id']                =               $id;
 
        $show                       =               $gqdemandM   ->  getGqtaskInfo($where, array('type' =>1));
 
        $this ->  yunset('show',  $show);
 
        
        $this ->  yunset('lasturl',   $_SERVER['HTTP_REFERER']);
 
        $this->yuntpl(array('admin/admin_gqtask_details'));
 
    }
  
    //浏览
    public function show_action(){
 
        $gqdemandM                        =                  $this -> MODEL('gqdemand');
 
        if($_GET['id']){
 
            $id                         =               intval($_GET['id']);
 
            $where['id']                =               $id;
 
            $show                       =               $gqdemandM   ->  getGqtaskInfo($where, array('type' =>1));
 
            $this ->  yunset('show',  $show);
 
            $time                       =               time();
            
            $this ->  yunset('time',  $time);
            
            $this ->  yunset('lasturl',   $_SERVER['HTTP_REFERER']);
            
        }
 
        $this->yuntpl(array('admin/admin_gqtask_show'));
 
    }
    //审核说明  type=>1:表示不查询里面联系表信息    type     =>  null   表示查询联系表信息
    public function  lockinfo_action(){
 
        $gqdemandM                        =                  $this -> MODEL('gqdemand');
 
        $id                             =               intval($_POST['id']);
 
        $where['id']                    =               $id;
 
        $tinfo                          =               $gqdemandM-> getGqtaskInfo($where,array('field'=>'`statusbody`','type'=>1));
        
        echo $tinfo['statusbody'];die;
 
    }
 
    //审核任务
    public function statis_action()
    {
 
        $gqdemandM    =    $this -> MODEL('gqdemand');
 
        $id            =@explode(',', $_POST['id']);
        
        if($_POST['status']  ==""){
 
            $this->ACT_layer_msg("请选择审核状态",8);return false;
 
        }
     
        if($id){
  
            $updata    =    array(
 
                'status'    =>    $_POST['status'],  
                'statusbody'=>    $_POST['statusbody']
            );
 
            $return    =    $gqdemandM -> upGqtaskStatus($id,$updata);
         
            $this -> ACT_layer_msg($return['msg'], $return['errcode'], $_SERVER['HTTP_REFERER'], 2, 1);
 
        }else{
 
            $this->ACT_layer_msg('非法操作!',8,$_SERVER['HTTP_REFERER']);
        }
    }
 
    //修改保存
    public function savetask_action(){
 
        $gqdemandM                        =                   $this -> MODEL('gqdemand');
 
        if($_POST['update']){
            
            $id                         =              intval($_POST['id']);
            
            $lasturl                    =              trim($_POST['lasturl']);
            
            if (!empty($id)) {
 
                $data                   =               array(
 
                    'name'              =>              $_POST['name'],
 
                    'salary'            =>              $_POST['salary'],
 
                    'edate'             =>              $_POST['edate'],
 
                    'etime'             =>              strtotime($_POST['etime']),
 
                    'content'           =>              str_replace(array('&amp;','background-color:#ffffff','background-color:#fff','white-space:nowrap;'),array('&','background-color:','background-color:','white-space:'),$_POST['content']),
 
                    'link_man'          =>              $_POST['link_man'],
 
                    'link_moblie'       =>              $_POST['link_moblie'],
 
                    'lastupdate'        =>              time(),
 
                    'hits'              =>              $_POST['hits']
 
                );
 
                $where['id']            =               $id;
                 
                $arr                    =               $gqdemandM -> upaddGqtask($where, $data,1);
                
                $this ->  ACT_layer_msg($arr['msg'],$arr['errcode'],$lasturl,2,1);
                    
            }else{
 
                $this->ACT_layer_msg('非法操作!',8,$lasturl);
 
            }           
 
        }
        
    }
 
    /**
     * @desc 获取项目发布任务数量
     */
    function gqtaskNum_action(){
 
        $MsgNum             =           $this->MODEL('msgNum');
        
        echo $MsgNum->taskNum();
        
    }
    
}
?>