chengkun
2025-04-30 6ab292fb7415be124651e312ec4f21c594568f17
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
<?php
 
class info_controller extends company{
    function index_action(){
 
        $companyM    =    $this->MODEL('company');
    
        //获取1-基本信息、 2-手机认证、 3-证书认证 
        $row        =    $companyM->getInfo($this->uid,array('info'=>'1', 'edit'=>'1','logo'=>'1','utype'=>'user'));
        if(!$row['uid']){
 
            //获取注册信息
            $userinfoM    =   $this->MODEL("userinfo");
            $row        =    $userinfoM -> getInfo(array('uid'=>$this -> uid),array('field'=>'`moblie` as linktel,`email` as linkmail,`moblie_status`,`email_status`'));
            
        }
        $this->yunset("row",$row);
        
        $this->yunset("cert",$row['cert']);
        
        $this->public_action();
        $this->company_satic();
        $this->yunset($this->MODEL('cache')->GetCache(array('com','city','job','hy')));
 
        $this->com_tpl('info');
    }
    
    function side_action(){
        $companyM    =    $this->MODEL('company');
        
        //获取1-基本信息、 2-手机认证、 3-证书认证 
        $row        =    $companyM->getInfo($this->uid,array('info'=>'1', 'edit'=>'1','logo'=>'1','utype'=>'user'));
 
        if(!$row['uid']){
            //获取注册信息
            $userinfoM    =   $this->MODEL("userinfo");
            $row        =    $userinfoM -> getInfo(array('uid'=>$this -> uid),array('field'=>'`moblie` as linktel,`email` as linkmail,`moblie_status`,`email_status`'));
            
        }
        $this->yunset("row",$row);
        
        $this->yunset("cert",$row['cert']);
        if (!$this->comInfo['name']) {
            $this->yunset('isremind', 1);
            $remindInfo['url']          =   'index.php?c=info';
            $remindInfo['msg']          =   '完善企业信息有助于帮您快速招聘人才!';
            $remindInfo['title']        =   '企业基本信息尚未完善!';
 
            $this->yunset('remindInfo', $remindInfo);
        }
        $this->public_action();
        $this->company_satic();
        $this->yunset($this->MODEL('cache')->GetCache(array('com','city','job','hy')));
 
        $this->com_tpl('side_info');
        
    }
    function save_action(){
        $companyM  =  $this->MODEL('company');
        $company    =   $this -> comInfo['info'];
         
        if($company){
            $rstaus     =   $company['r_status'];
        }else{
            $rstaus        =    $this->config['com_status'];
        }
 
 
        $mData     =  array(
            'moblie'        =>  $_POST['linktel'],
            'email'         =>  $_POST['linkmail']
        );
        
        $setData   =  array(
            'name'             =>     $_POST['name'], 
            'shortname'     =>     $_POST['shortname'], 
            'hy'             =>     $_POST['hy'], 
            'pr'             =>     $_POST['pr'], 
            'mun'             =>     $_POST['mun'], 
            'provinceid'     =>    $_POST['provinceid'], 
            'cityid'         =>     $_POST['cityid'],
            'three_cityid'     =>     $_POST['three_cityid'], 
            'address'         =>    $_POST['address'],
            'x'             =>    $_POST['x'],
            'y'             =>    $_POST['y'],
            'linkman'        =>     $_POST['linkman'], 
            'linktel'        =>    $_POST['linktel'], 
            'linkphone'     =>     $_POST['linkphone'], 
            'linkmail'         =>     $_POST['linkmail'], 
            'sdate'         =>     $_POST['sdate'], 
            'moneytype'     =>     $_POST['moneytype'], 
            'money'         =>    $_POST['money'], 
            'linkjob'         =>     $_POST['linkjob'], 
            'linkqq'         =>     $_POST['linkqq'], 
            'website'         =>     $_POST['website'], 
            'busstops'         =>     $_POST['busstops'], 
            'infostatus'     =>     $_POST['infostatus'], 
            'welfare'         =>     $_POST['welfare'], 
            'r_status'         =>     $rstaus,
            'rating'        =>    $company['rating'],
            'lastupdate'    =>  time(),
            'content'        =>     str_replace(array('&amp;','background-color:#ffffff','background-color:#fff','white-space:nowrap;'),array('&','background-color:','background-color:','white-space:'),$_POST['content'])
        );
 
        $userinfoM    =   $this->MODEL("userinfo");
 
        if(!$this -> comInfo['info']['uid']){
            
            $userinfoM -> activUser($this -> uid,2);
        }
         
        $return   =   $companyM -> setCompany(array('uid' => $this -> uid), array('mData' => $mData, 'comData' => $setData, 'utype' => 'user'));  
        
        //根据后台设置 修改企业资料重新审核
        if($this -> config['com_revise_status'] == '0'){
 
            
            $userinfoM -> status(array('uid' => $this -> uid,'usertype'=>2), array('post' => array('status' => 0)));
        
        }
        if($return['errcode'] == '9' && $_SESSION['auid'] == $this->comInfo['info']['crm_uid']){    // 绑定CRM 修改企业资料进行记录
            
            $crmM     =   $this->MODEL('crm');
            $lContent    =    "";
            
            $lKey    =    array('name','address','linkman','linktel');
            $kName    =    array('name' => '企业名称', 'hy' => '从事行业', 'pr' => '企业性质', 'mun' => '企业规模', 'address' => '详细地址', 'linkman' => '联系人', 'linktel' => '联系手机');
            
            $cacheM        =      $this -> MODEL('cache');
            $cache        =    $cacheM->GetCache(array('com', 'hy'));
            
            foreach($this->comInfo['info'] as $k => $v){
                if(trim($v) != trim($_POST[$k])){    
                    if(in_array($k, $lKey)){
                        $lContent    .=    $kName[$k].":".$v." -> ".$_POST[$k].";";            
                    }else if(in_array($k, array('pr', 'mun'))){
                        $lContent    .=    $kName[$k].":".$cache['comclass_name'][$v]." -> ".$cache['comclass_name'][$_POST[$k]].";";        
                    }else if(in_array($k, array('hy'))){
                        $lContent    .=    $kName[$k].":".$cache['industry_name'][$v]." -> ".$cache['industry_name'][$_POST[$k]].";";        
                    }
                }
            }
            if($lContent!= ''){
                $lContent    =    '登录企业(UID:'.$this->uid.')后台,修改基本信息资料;'.$lContent;    
                $crmM -> addCrmLog($lContent, 2, $this->uid, $_SESSION['auid']);
                
                $value    =   array(
                  
                    'auid'    =>  $_SESSION['auid'],
                    'uid'     =>  $this->uid,
                    'type'    =>  5,  // 修改企业资料
                    'content' =>  '【修改客户资料】',
                    'remark'  =>  $lContent,
                    'ctime'   =>  time()
                );
                $crmM -> addCrmComLog($value);
            }
        }
        
        echo json_encode($return);die;
    }
    
    /**
    * 更新公司补充信息
    */
    function saveside_action(){
        $companyM  =  $this->MODEL('company');
        $company    =   $this -> comInfo['info'];
        if($company){
            $rstaus     =   $company['r_status'];
        }else{
            $rstaus        =    $this->config['com_status'];
        }
        $mData     =  array(
            'moblie'        =>  $_POST['linktel'],
            'email'         =>  $_POST['linkmail']
        );
        
        $setData   =  array(
            'shortname'     =>     $_POST['shortname'], 
            'sdate'         =>     $_POST['sdate'], 
            'moneytype'     =>     $_POST['moneytype'], 
            'money'         =>    $_POST['money'], 
            'linkjob'         =>     $_POST['linkjob'], 
            'linkqq'         =>     $_POST['linkqq'], 
            'website'         =>     $_POST['website'], 
            'busstops'         =>     $_POST['busstops'], 
            'infostatus'     =>     $_POST['infostatus'], 
            'welfare'         =>     $_POST['welfare'], 
            'r_status'         =>     $rstaus,
            'rating'        =>    $company['rating'],
            'lastupdate'    =>  time()
        );
 
        $userinfoM    =   $this->MODEL("userinfo");
        if(!$this -> comInfo['info']['uid']){
            $userinfoM -> activUser($this -> uid,2);
        }
        $return   =   $companyM -> setCompanySideInfo(array('uid' => $this -> uid), array('comData' => $setData, 'utype' => 'user'));  
        
        //根据后台设置 修改企业资料重新审核
        if($this -> config['com_revise_status'] == '0'){
            $userinfoM -> status(array('uid' => $this -> uid,'usertype'=>2), array('post' => array('status' => 0)));
        }
 
        echo json_encode($return);die;
    }
    /**
     * @desc 查询企业名称和手机号码是否使用
     */
    function ajaxCheck_action(){
        if($_POST){
            
            $comM      =   $this->MODEL('company');
            
            $typeStr   =   trim($_POST['typeStr']);
            $checkStr  =   trim($_POST['checkStr']);
            
            $return    =   $comM -> getCheckUsed($this->uid, array('typeStr' => $typeStr, 'checkStr' => $checkStr));
            
            echo json_encode($return);die;
        }
    }
}
?>