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
<?php
 
class article_controller extends common{
    /**
     * 职场资讯
     */
    function index_action(){
        $this->get_moblie();
        
        if ($_COOKIE['newc']){
            $newc    =    explode(',', $_COOKIE['newc']);
            $this->yunset('newc',$newc);
            $this->yunset($this->MODEL('cache')->GetCache(array('group')));
        }
        $this->yunset("headertitle","职场资讯");
        $this->yunset('backurl','index.php');
        $this->seo("news");
        $this->yuntpl(array('wap/article'));
    }
 
    /**
     * 职场资讯-详情
     */
    function show_action(){
        $this->get_moblie();
        $articleM    =    $this->MODEL('article');
        $id            =    (int)$_GET[id];
        $nwhere['id']=    $id;
        if($this->config['did']>0){
            $nwhere['PHPYUNBTWSTART_A']    =    '' ;
            $nwhere['did'][]    =    array('=',$this->config['did']);
            $nwhere['did'][]    =    array('=','-1','OR');
            $nwhere['PHPYUNBTWEND_A']    =    '' ;
        }
        $info        =     $articleM->getInfo($nwhere,array('iscon'=>1));
        $this->yunset("Info",$info);
        $class        =    $articleM->getGroup(array("id"=>$info['nid']));
        if($info["keyword"]!=""){
            //分割关键字
            $keyarr     =     @explode(",",$info["keyword"]);
            if(is_array($keyarr) && !empty($keyarr)){
                $where['PHPYUNBTWSTART_A']    =    '' ;
                foreach($keyarr as $key=>$value){
                    $where['keyword'][]        =    array('like',$value,'OR') ;
                }
                $where['PHPYUNBTWEND_A']    =    '' ;
                $where['id']                =    array('<>',$id);
                $where['orderby']            =    'id,desc';
                if($this->config['did']>0){
                    $where['PHPYUNBTWSTART_B']    =    '' ;
                    $where['did'][]    =    array('=',$this->config['did']);
                    $where['did'][]    =    array('=','-1','OR');
                    $where['PHPYUNBTWEND_B']    =    '' ;
                }
                $where['limit']                =    6;
                
                $aboutlist    =    $articleM->getList($where);//相关文章
                $about        =    $aboutlist['list'];
                
                if(is_array($about)){
                    foreach($about as $k=>$v){
                        if($this->config['sy_news_rewrite']=="2"){
                            
                            $about[$k]["url"]=$this->config['sy_weburl']."/article/".date("Ymd",$v["datetime"])."/".$v['id'].".html";
                            
                        }else{
                            $about[$k]["url"]= Url("wap",array('c'=>'article','a'=>'show',"id"=>$v[id]),"1"); 
                        }
                    }
                }
            }
        }
        $this->yunset("about",$about);
        
        $data['news_class']        =    $class['name'];//新闻类别
        $data['news_title']        =    $info['title'];//新闻名称
        $data['news_keyword']    =    $info['keyword'];//描述  
        $description            =    $info['description']?$info['description']:$info['content'];
        $data['news_desc']        =    $this->GET_content_desc($description);//描述 
        $this->data                =    $data; 
        $this->seo("news_article");
        
        $this->yunset("headertitle","职场资讯");
        
        $this->yuntpl(array('wap/article_show'));
    }
 
    /**
     * 职场资讯-频道管理
     */
    function channels_action(){
        if ($_COOKIE['newc'] && $_COOKIE['oldc']){
            $newc    =    explode(',', $_COOKIE['newc']);
            $oldc    =    explode(',', $_COOKIE['oldc']);
            $this->yunset('newc',$newc);
            $this->yunset('oldc',$oldc);
            $this->yunset($this->MODEL('cache')->GetCache(array('group')));
        }
        $this->seo("news");
        
        $this->yunset("headertitle","频道管理");
        $this->yuntpl(array('wap/article_channels'));
    }
 
    /**
     * 职场资讯-频道管理-编辑频道
     */
    function editchannels_action(){
        if ($_POST['newc']){
            $oldc    =    @pylode(',', $_POST['oldc']);
            $newc    =    @pylode(',', $_POST['newc']);
            $this->cookie->setcookie('oldc',$oldc,time()+86400);
            $this->cookie->setcookie('newc',$newc,time()+86400);
            echo Url('wap',array('c'=>'article'));die;
        }else{
            echo 1;die();
        }
    }
 
    /**
     * 职场资讯-详情-获取点击量
     */
    function GetHits_action() {
        if($_GET['id']){
            $articleM    =    $this->MODEL('article');
            $articleM->upBase(array('id'=>(int)$_GET['id']),array('hits'=>array('+',1)));
            
            $hits        =    $articleM->getInfo(array('id'=>(int)$_GET['id']),array('field'=>'hits'));
           echo 'document.write('.$hits['hits'].')';
        }
    }
}
?>