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
<?php
 
class privacy_controller extends user_controller{
    //隐私设置列表
    function privacy_action(){
        
        $ResumeM    =    $this -> MODEL('resume');
        $resume        =    $ResumeM -> getResumeInfo(array('uid'=>$this->member['uid']),array('field'=>'`status`'));
        $status        =    $resume['status'];
 
        $this->render_json(0,'',$status);
    }
 
    //屏蔽企业列表
    function blacklist_action(){ 
        $blackM                        =    $this->MODEL('black');
        
        $where['c_uid']                =    $this->member['uid'];
        $where['usertype']            =    '1';
        $total = $blackM->getBlackNum($where);
        $page        =    $_POST['page'];
        $limit        =    $_POST['limit'];
        $limit        =    !$limit?20:$limit;
    
            
        $where['orderby']    =    'id,desc';
        if($page){
            $pagenav        =    ($page-1)*$limit;
            $where['limit']    =    array($pagenav,$limit);
        }else{
            $where['limit']    =    array('',$limit);
        }
        $rows = $blackM->getBlackList($where);
            
        if($rows && is_array($rows)){
            $list    =    count($rows)?$rows:array();
            
            $this->render_json(1,'ok',$list,$total);
        }else{
            $this->render_json(2,'','');
        }
        
    }
    //隐私设置保存
    function up_action(){
            $resumeM    =    $this->MODEL('resume');
            $logM        =    $this->MODEL('log');
 
            $return=$resumeM->upResumeInfo(array('uid'=>$this->member['uid']),array('rData'=>array('status'=>intval($_POST['status'])))); 
            $resumeM->upInfo(array('uid'=>$this->member['uid']),array('eData'=>array('status'=>intval($_POST['status']))));
            $status = $resumeM->getResumeInfo(array('uid'=>$this->member['uid']),array('field'=>'status'));
 
            if(intval($_POST['status'])==2){
                $stext    =    '隐藏';
            }else if(intval($_POST['status'])==1){
                $stext    =    '公开';
            }
            $logM->addMemberLog($this->member['uid'],$this->member['usertype'],"设置简历为".$stext,2,2);
 
            $data['error']    =    $return['errcode']==9 ? 1 : 2;
            $data['msg']    =    $return['msg']; 
            
            $this->render_json($data['error'],$data['msg'],$status);
    }
    //删除屏蔽企业
    function del_action(){
            $blackM        =    $this->MODEL('black');
            $id            =    (int)$_POST['id'];
            
            $return        =    $blackM->delBlackList($id,array('where'=>array('c_uid'=>$this->member['uid'])));
            
            if($return['errcode']==9){
                $error    =    1;
            }else{
                $error    =    2;    
             }
    $this-> render_json($error,$return['msg'],$return);
}
    //清空屏蔽企业
    function delall_action(){
        $blackM        =    $this->MODEL('black');
        
        $return        =    $blackM->delBlackList('',array('uid'=>$this->member['uid'],'usertype'=>$this->member['usertype'],'where'=>array('c_uid'=>$this->member['uid']),'type'=>'all'));
        
        if($return['errcode']==9){
                $error    =    1;
            }else{
                $error    =    2;    
             }
        $this-> render_json($error,$return['msg'],$return);
    }
    //搜索要屏蔽的企业
    function searchcom_action(){
        $blackM            =    $this->MODEL('black');
        $companyM        =    $this->MODEL('company');
        $keyword          =    trim($_POST['keyword']);
        if($keyword!=''){
            $blacklist        =    $blackM->getBlackList(array('c_uid'=>$this->member['uid']),array('field'=>'`p_uid`'));
            if($blacklist && is_array($blacklist)){
                $uids            =    array();
                foreach($blacklist as $v){
                    
                    if($v['p_uid'] && !in_array($v['p_uid'],$uids)){
                        
                        $uids[]    =    $v['p_uid'];
                    }
                }
                $where['uid']    =    array('notin',pylode(',',$uids));
            }
            $where['name']        =    array('like',$keyword);
            $company            =    $companyM->getList($where,array('field'=>'`uid`,`name`'));
            $company            =    $company['list'];
        }
        
        
         if($company && is_array($company)){
            
              foreach($company as $val){
                   $return[] = $val;
              }
              $this->render_json(1,'ok',$return);
          }else{
 
              $this->render_json(2,'','');
                
          }
    }
    //保存要屏蔽的企业
    function save_action(){
        
        $blackM        =  $this->MODEL('black');
        $data        =    array(
            'cuid'        =>    $_POST['p_uid'],
            'uid'        =>    $this->member['uid'],
            'usertype'    =>    1
        );
        $return        =  $blackM -> addBlacklist($data);
        
        if($return['errcode']==9){
            $error =1;
        }else{
            $error=2;
        }
        $this ->render_json($error,$return['msg']);
    }
}
?>