chengkun
2025-05-20 4c1f0f659384d71ce28be1fc0343e56e75568fe1
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
<?php
 
class info_controller extends com_controller{
 
    /**
     * 获取企业信息
     */
    function getinfo_action()
    {
 
        $companyM  =  $this->MODEL('company');
        $resumeM  =  $this->MODEL('resume');
        $info      =  $companyM->getInfo($this->member['uid'],array('edit'=>'1','logo'=>'1','utype'=>'user','setname'=>'1'));
 
        if (!empty($_POST['source']) && $_POST['source'] == 'wap') { // WAP站百度坐标系,不需要转
        } else {
            if($info['x'] && $info['y']){
                $newxy  =  $this->Convert_BD09_To_GCJ02($info['x'], $info['y']);
                $info['x']  =  $newxy['lng'];
                $info['y']  =  $newxy['lat'];
            }
        }
 
        $comcert   =  $companyM->getCertInfo(array('uid'=>$this->member['uid'],'type'=>3));
 
        $info['cert_pic']   =  $comcert['check'];
 
        if(!empty($info['content'])){
            $info['content_t']  =  strip_tags($info['content']);
        }
 
        $cacheM    =  $this->MODEL('cache');
        $cache     =  $cacheM->GetCache('com');
        //福利缓存数据
        if(is_array($cache['comdata']['job_welfare'])){
            foreach($cache['comdata']['job_welfare'] as $k=>$v){
                $welfareData[]    =    $cache['comclass_name'][$v];
                $welfaresy[]    =    array('name'=>$cache['comclass_name'][$v],'ischecked'=>0);
            }
        }
        $welfareArr     =    array_unique(array_merge($info['arraywelfare'],$welfareData));
 
        $welfareAll  =  $w  =  array();
 
        foreach($welfareArr as $k=>$v){
            $w['name']  =  $v;
            if(in_array($v,$info['arraywelfare'])){
                $w['ischecked']     =    1;
            }else{
                $w['ischecked']     =    0;
            }
            $welfareAll[]  =  $w;
        }
        if($welfareAll){
            $info['welfareAll']  =  $welfareAll;
        }else{
            $info['welfareAll']  =  $welfaresy;
        }
 
        $usernum    =    $resumeM->getResumeNum(array('uid'=>$this->member['uid']));
        $info['usernum']        =    $usernum;
 
        $info['cuswitch']   =  $this->config['sy_user_change'];
        $info['setPosition']=  $this->config['com_enforce_setposition'];
 
        include(CONFIG_PATH.'db.data.php');
        // 根据是否有猎头模块,来确定是否有子账号功能
        $info['sy_son']     =  isset($arr_data['modelconfig']['lietou']) ? 1 : 2;
        $info['app_push']   =  $this->member['app_push'];
        $info['usertype'] = $this->usertype;
        $info['sy_lietou_web'] = $this->config['sy_lietou_web'];
        $info['sy_train_web'] = $this->config['sy_train_web'];
        
        if (isset($_POST['provider']) && ($_POST['provider'] == 'weixin' || $_POST['provider'] == 'baidu')) {
            // 小程序关联登录入口判断
            if ($_POST['provider'] == 'weixin'){
                @include(DATA_PATH.'api/wxpay/wxpay_data.php');
                if (isset($wxpaydata)){
                    if($wxpaydata['sy_xcxappid'] == '' || $wxpaydata['sy_xcxsecret'] ==''){
                        $info['isWxopen'] = false;
                    }else{
                        $info['isWxopen'] = true;
                    }
                }
            }
            if ($_POST['provider'] == 'baidu'){
                @include(DATA_PATH . 'api/baidu/baidu_data.php');
                if (isset($baiduData)) {
                    if($baiduData['sy_bdlogin_appKey'] == '' || $baiduData['sy_bdlogin_appSecret'] == ''){
                        $info['isBdopen'] = false;
                    }else{
                        $info['isBdopen'] = true;
                    }
                }
            }
        }
 
        $this->render_json(0, 'ok', $info);
    }
 
    function saveinfo_action()
    {
        $companyM     =   $this->MODEL('company');
 
        if(isset($this->comInfo['r_status'])){
            $rstaus  =  $this->comInfo['r_status'];
        }else{
            $rstaus  =  $this->config['com_status'];
        }
 
        $mData     =  array(
            'moblie'        =>  $_POST['linktel'],
            'email'         =>  $_POST['linkmail']
        );
        $x = $_POST['x'];
        $y = $_POST['y'];
        $source = $_POST['source'];
        if (!empty($_POST['source']) && $_POST['source'] == 'wap') { // WAP站百度坐标系,不需要转
            $source = 2;
        } else {
            if($x && $y){
                $bd09 = $this->Convert_GCJ02_To_BD09($x, $y);
                $x = $bd09['lng'];
                $y = $bd09['lat'];
            }
        }
        $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'             =>    $x,
            'y'             =>    $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'],
            'photos'         =>     $_FILES['photos'],
            'preview'       =>  $_POST['preview'],
            'lastupdate'    =>  time(),
            'r_status'         =>     $rstaus,
            '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(empty($this -> comInfo['uid'])){
 
            $userinfoM -> activUser($this->member['uid'],2);
        }
 
        $return =  $companyM -> setCompany(array('uid'=>$this->member['uid']),array('mData'=>$mData,'comData'=>$setData,'utype'=>'user','wap'=>1,'source'=>$source));
 
        //根据后台设置 修改企业资料重新审核
        if($this -> config['com_revise_status'] == '0'){
 
 
            $userinfoM -> status(array('uid' => $this ->member['uid'],'usertype'=>2), array('post' => array('status' => 0)));
 
        }
 
        if($return['errcode'] == 9){
            $error    =  1;
        }else{
            $error    =  2;
        }
        $msg  =  preg_replace('/\([^\)]+?\)/x','',$return['msg']);
        $this->render_json($error, $msg);
    }
 
    function savephoto_action()
    {
        $companyM    =    $this->MODEL('company');
 
        if(empty($this->member['uid'])){
            $error    =    3;
            $msg    =    '参数不正确';
        }else{
            if(empty($this -> comInfo['uid'])){
                $userinfoM  =  $this->MODEL("userinfo");
                $userinfoM -> activUser($this->member['uid'],2);
            }
 
            $data['utype'] = 'user';
            $data['source'] = $_POST['source'];
            if($_POST['source'] == 'wap'){
                $data['source'] = 2;
                $data['base'] = $_POST['uimage'];
            }else{
                $data['photo'] = $_FILES['photos'];
            }
 
            $return    =  $companyM -> upLogo(array('uid'=>$this->member['uid']), $data);
            $msg    =  preg_replace('/\([^\)]+?\)/x','',$return['msg']);
        }
        $this->render_json(1, $msg);
    }
 
    function show_action()
    {
        $companyM    =    $this->MODEL('company');
 
        if(empty($this->member['uid'])){
            $this->render_json(3, '参数不正确');
        }else{
            $where['uid']    =    $this->member['uid'];
            !empty($_GET['pageSize']) && $where['limit'] = $_GET['pageSize'];
            $where['orderby']        =    'sort,desc';
 
            $List                    =    $companyM->getCompanyShowList($where,array('field'=>'`title`,`id`,`picurl`'));
 
            $this->render_json(0, 'ok', array('list' => $List));
        }
    }
 
    function showsave_action()
    {
        $companyM    =    $this->MODEL('company');
 
        if(empty($this->member['uid'])){
            $error    =    3;
            $msg    =    '参数不正确';
        }else{
            if($_POST['wappic']==1){
                $data['base'] = $_POST['uimage'];
            }else {
                $data['file'] = $_FILES['pic'];
            }
            $data['uid'] = $this->member['uid'];
 
            $data['r_status'] = $this->comInfo['info']['r_status'];
 
            $return = $companyM->setShow($data);
            if ($return['errcode'] == '9') {
                $error = 1;
            } else {
                $error = 2;
            }
            $msg = preg_replace('/\([^\)]+?\)/x', '', $return['msg']);
        }
 
        $this->render_json($error, $msg, array('id' => !empty($return['id']) ? $return['id'] : ''));
    }
 
    function showdel_action(){
        $companyM    =    $this->MODEL('company');
        $logM        =    $this->MODEL('log');
 
        if(empty($this->member['uid']) || empty($_POST['id'])){
            $error    =    3;
            $msg    =    '参数不正确';
        }else{
            $oid    =    $companyM->delCompanyShow(is_array($_POST['id']) ? $_POST['id'] : explode(',', $_POST['id']),array('uid'=>$this->member['uid']));
 
            if($oid){
                $logM->member_log("删除企业环境展示",16,3);//会员日志
 
                $error    =    1;
                $msg    =    '删除成功';
            }else{
                $error    =    2;
                $msg    =    '删除失败';
            }
        }
        $this->render_json($error, $msg);
    }
}
?>