chengkun
2025-04-18 1bb985f32f2efe0f9dd69f3cf29a1c809b1cf96d
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
340
341
<?php
/*
* $Author :PHPYUN开发团队
*
* 官网: http://www.phpyun.com
*
* 版权所有 2009-2021 宿迁鑫潮信息技术有限公司,并保留所有权利。
*
* 软件声明:未经授权前提下,不得用于商业运营、二次开发以及任何形式的再次发布。
 */
class tiny_controller extends wxapp_controller{
    function list_action(){//微简历列表
        $tinyM        =    $this->MODEL('tiny');
        $where['status']    =    '1';
        $keyword    =    $this->stringfilter($_POST['keyword']);
        $provinceid            =    (int)$_POST['provinceid'];
        $cityid                =    (int)$_POST['cityid'];
        $three_cityid        =    (int)$_POST['three_cityid'];
        $page        =    $_POST['page'];
        $sex        =    (int)$_POST['sex'];
        $edu        =    (int)$_POST['edu'];
        $limit        =    $_POST['limit'];
        $order        =    $_POST['order'];
        $nodata        =    $_POST['nodata'];
        $limit        =    !$limit?10:$limit;
        if($sex){//类别ID
            $where['sex']    =    $sex;
        }
        if($edu){//类别ID
            $where['edu']    =    $edu;
        }
        if($keyword){//关键字
            
            $where['PHPYUNBTWSTART_A']    =    '';
            $where['username']    =    array('like',$keyword);
            $where['job']        =    array('like',$keyword,'OR');
            
            $where['PHPYUNBTWEND_A']    =    '';
        }
 
        
        if($nodata){//排除没有值的字段
            $nodataarr    =    explode(",",$nodata);
            foreach($nodataarr as $v){
                $where[$v]    =    array('<>','');
            }
        }
        if($provinceid){//类别ID
            $where['provinceid']=    $provinceid;
        }
        if($cityid){//类别ID
            $where['cityid']    =    $cityid;
        }
        if($three_cityid){//类别ID
            $where['three_cityid']    =    $three_cityid;
        }
        // 处理分站查询条件
        if (!empty($_POST['did'])){
            
            $domain  =  $this->getDomain($_POST['did'], true);
            
            if (isset($domain['didcity'])){
                
                $data['didcity']    =  $domain['didcity'];
                
                if (!empty($_POST['provinceid'])){
                    // 分站下,再次选择城市,查询按选择的来
                    $where['provinceid']  =  $_POST['provinceid'];
                    $data['didcity']      =  $domain['city_name'][$_POST['provinceid']];
                }elseif (!empty($domain['provinceid'])){
                    $where['provinceid']  =  $domain['provinceid'];
                }
                if (!empty($_POST['cityid'])){
                    // 分站下,再次选择城市,查询按选择的来
                    $where['cityid']  =  $_POST['cityid'];
                    $data['didcity']  =  $domain['city_name'][$_POST['cityid']];
                }elseif (!empty($domain['cityid'])){
                    $where['cityid']  =  $domain['cityid'];
                }
                if (!empty($_POST['three_cityid'])){
                    // 分站下,再次选择城市,查询按选择的来
                    $where['three_cityid']  =  $_POST['three_cityid'];
                    $data['didcity']        =  $domain['city_name'][$_POST['three_cityid']];
                }elseif (!empty($domain['three_cityid'])){
                    $where['three_cityid']  =  $domain['three_cityid'];
                }
                
                $data['cityone']    =  $domain['cityone'];
                $data['citytwo']    =  $domain['citytwo'];
                $data['citythree']  =  $domain['citythree'];
                $data['provinceid']    =  !empty($where['provinceid']) ? intval($where['provinceid']) : 0;
                $data['cityid']        =  !empty($where['cityid']) ? intval($where['cityid']) : 0;
                $data['three_cityid']  =  !empty($where['three_cityid']) ? intval($where['three_cityid']) : 0;
            }
        }else{
            // 没有已选择的城市,按后台设置的列表页区域默认设置来(后台-页面设置-列表页区域默认设置)
            // 设置了一级城市,后面的搜索,不再展示其他一级城市
            if (empty($_POST['provinceid']) && empty($_POST['cityid']) && empty($_POST['three_cityid']) || (!empty($_POST['provinceid']) && $_POST['provinceid'] == $this->config['sy_web_city_one'])){
                
                $list_cityid      = isset($where['cityid']) ? $where['cityid'] : 0;
                $list_threecityid = isset($where['three_cityid']) ? $where['three_cityid'] : 0;
                
                $listback = $this->listCity($list_cityid, $list_threecityid);
                if (!empty($listback)) {
                    if (isset($listback['provinceid'])){
                        $where['provinceid']  =  $listback['provinceid'];
                    }
                    if (isset($listback['cityid'])){
                        $where['cityid']  =  $listback['cityid'];
                    }
                    if (isset($listback['listcity'])){
                        $data['listcity']   =  $listback['listcity'];
                        $data['cityone']    =  $listback['cityone'];
                        $data['citytwo']    =  $listback['citytwo'];
                        $data['citythree']  =  $listback['citythree'];
                        
                        $data['provinceid']    =  !empty($where['provinceid']) ? intval($where['provinceid']) : 0;
                        $data['cityid']        =  $list_cityid;
                        $data['three_cityid']  =  $list_threecityid;
                    }
                }
            }
        }
        if($order){//排序
            $where['orderby']    =    $order.',desc';
        }else{
            $where['orderby']    =    'id,desc';
        }
        if($page){//分页
            $pagenav    =    ($page-1)*$limit;
            $where['limit']        =    array($pagenav,$limit);
        }else{
            $where['limit']        =    array('',$limit);
        }
        $rows    =    $tinyM->getResumeTinyList($where);
        $List    =    $rows['list'];
        if($List && is_array($List)){
            $data['list']    =    count($List)?$List:array();
            // 小程序用seo
            if (isset($_POST['provider'])){
                if ($_POST['provider'] == 'baidu' || $_POST['provider'] == 'weixin' || $_POST['provider'] == 'toutiao'){
                    $seo            =  $this->seo('tiny','','','',false, true);
                    $data['seo']    =  $seo;
                }
            }
            $error    =    1;
        }else{
            $error    =    2;
        }
        $this->render_json($error,'',$data);
    }
    function show_action(){//微简历内容
        $id        =    (int)$_POST['id'];
        if(!$id){
            $data['error']    =    3;
        }else{
            $tinyM    =    $this->MODEL('tiny');
            $row    =    $tinyM->getResumeTinyInfo(array('id'=>$id));
            $tinyM->upResumeTiny(array('hits'=>array('+',1)),array('id'=>$id));
            if(is_array($row)){
                $data['user_wjl_link']    =    $this->config['user_wjl_link'];
                
                if (!empty($row['production'])){
                    $row['production'] = $this->preghtml($row['production']);
                }
                
                $data['list']    =    count($row)?$row:array();
                if (isset($_POST['provider'])){
                    // app用分享数据
                    if ($_POST['provider'] == 'app'){
                        
                        $data['shareData']  =  array(
                            'url'       =>  Url('wap',array('c'=>'zphnet','a'=>'show','id'=>$id)),
                            'title'     =>  $row['job'],
                            'summary'   =>  mb_substr(strip_tags($row['production']), 0,30,'UTF8'),
                            'imageUrl'  =>  checkpic($this->config['sy_wx_sharelogo'])
                        );
                    }
                    // 小程序用seo
                    if ($_POST['provider'] == 'baidu' || $_POST['provider'] == 'weixin' || $_POST['provider'] == 'toutiao'){
                        $seodata['tiny_username']    =    $row['username'];
                        $seodata['tiny_job']        =    $row['job'];
                        $seodata['tiny_desc']        =    $row['production'];
                        $this->data            =    $seodata;
                        if ($_POST['provider'] == 'baidu' || $_POST['provider'] == 'weixin' || $_POST['provider'] == 'toutiao'){
                            $seo            =   $this->seo('tiny_cont','','','',false, true);
                            $data['seo']    =   $seo;
                        }
                    }
                }
                $error    =    1;
            }else{
                $error    =    2;
            }
        }
        $this->render_json($error,'',$data);
    }
 
    function add_action(){
        $_POST    =    $this->post_trim($_POST);
        $tinyM    =     $this ->  MODEL('tiny');
        if($_POST['submit']){
            if(!$_POST['username'] || !$_POST['password'] || !$_POST['sex'] || !$_POST['exp'] || !$_POST['mobile'] || !$_POST['production'] || !$_POST['job']){
                $data['error']    =    3;
                $data['msg']    =    '请完善信息!';
                echo json_encode($data);die;
            }
 
            $post    =   array(
                'username'         =>  $_POST['username'],
                'sex'             =>  $_POST['sex'],
                'exp'             =>  $_POST['exp'],
                'job'             =>  $_POST['job'],
                'mobile'         =>  $_POST['mobile'],
                'password'        =>    $_POST['password'],
                'provinceid'     =>  $_POST['provinceid'],
                'cityid'         =>  $_POST['cityid'],
                'three_cityid'    =>  $_POST['three_cityid'],
                'production'     =>  $_POST['production'],
                'status'         =>  $this->config['user_wjl'],
                'login_ip'        =>    fun_ip_get(),
                'time'            =>    time(),
                'lastupdate'    =>    time(),
                'did'            =>    0
            );
            $addData    =    array(
                'id'                =>    (int)$_POST['id'],
                'post'                =>    $post,
                'moblie_code'                =>    $_POST['moblie_code'],
                'type'                =>    'wxapp'
            );
                        
            $return    =     $tinyM  ->  addResumeTinyInfo($addData,'wxapp');
            if($return['errcode']==9){
                $error    =    1;
            }else{
                $error    =    2;
            }
        }else{
            
            $data    =    $tinyM->getResumeTinyInfo(array('id'=>(int)$_POST['id']));
        }
        $data['ismoblie_code'] = $this->config['sy_msg_isopen'];
        $this -> render_json($error,$return['msg'],$data);
 
    }
    function pass_action(){
        $id    =    (int)$_POST['id'];
        if(!$_POST['password'] || !$id){
            $data['error']    =    3;
        }else{
            $tinyM    =     $this ->  MODEL('tiny');
            $data    =    array(
                //'code'        =>  1,
                'id'        =>    (int)$_POST['id'],
                'password'    =>    $_POST['password'],
                'type'        =>    2
            );
            $return        =    $tinyM->setResumeTinyPassword($data);
            if($return['errcode']==9){
                $error    =    1;
            }else{
                $error    =    2;
            }
        }
        $this -> render_json($error,$return['msg']);
    }
    function del_action(){
        $id    =    (int)$_POST['id'];
        if(!$_POST['password'] || !$id){
            $data['error']    =    3;
        }else{
            $tinyM    =     $this ->  MODEL('tiny');
            $data    =    array(
                //'code'        =>    1,
                'id'        =>    (int)$_POST['id'],
                'password'    =>    $_POST['password'],
                'type'        =>    3
            );
            $return        =    $tinyM->setResumeTinyPassword($data);
            
            if($return['errcode']==9){
                $rdata['error']    =    1;
            }else{
                $rdata['error']    =    2;
            }
            $rdata['msg']    =    $return['msg'];
        }
        $this -> render_json($rdata['error'],$rdata['msg']);
    }
    function editctime_action(){
        $id    =    (int)$_POST['id'];
        if(!$_POST['password'] || !$id){
            $data['error']    =    3;
        }else{
            $tinyM    =     $this ->  MODEL('tiny');
            $data    =    array(
                //'code'        =>    1,
                'id'        =>    (int)$_POST['id'],
                'password'    =>    $_POST['password'],
                'type'        =>    1
            );
            $return        =    $tinyM->setResumeTinyPassword($data);
     
            if($return['errcode']==9){
                $nid    =    $tinyM->upResumeTiny(array('time'=>time()),array('id'=>$id));
                 
                if($nid){
                    $rdata['error']    =    1;
                    $rdata['msg']    =    '修改成功!';
                }else{
                    $rdata['error']    =    2;
                    $rdata['msg']    =    '修改失败!';
                }
            }else{
                $rdata['error']    =    2;
                $rdata['msg']    =    $return['msg'];
            }
        }
            $this -> render_json($rdata['error'],$rdata['msg']);
    }
    function isadd_action(){
        $tinyM    =     $this ->  MODEL('tiny');
        $data['sy_tiny']    =    $this->config['sy_tiny'];
        $ip     =     fun_ip_get();
        $m_tiny_total    =    $tinyM->getResumeTinyNum(array('time'=>array('>',strtotime('today'))));
        $m_tiny    =    $tinyM->getResumeTinyNum(array('login_ip'=>$ip,'time'=>array('>',strtotime('today'))));
        $data['num'] = $this->config['sy_tiny'] - $m_tiny ;
        if(($this->config['sy_tiny_totalnum'] > $m_tiny_total) || $this->config['sy_tiny_totalnum'] == 0){
            if($this->config['sy_tiny']>$m_tiny||$this->config['sy_tiny']<1){
                $data['isadd']    =    true;
            }else{
                $data['isadd']    =    false;
            }
        }else{
            $data['isadd'] = false;
        }
        $this->render_json(0, 'ok', $data);
    }
}
?>