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
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
<?php
 
 
 
class part_controller extends wxapp_controller
{
 
    function list_action()
    {
 
        $partM  =   $this->MODEL('part');
 
        $where['state']     =   1;
 
        $where['r_status']  =   array('<>', 2);
 
        $where['PHPYUNBTWSTART_A']  =   '';
        $where['edate'][]           =   array('>', time());
        $where['edate'][]           =   array('=', 0, 'or');
        $where['PHPYUNBTWEND_A']    =   '';
 
        if ($this->config['sy_datacycle'] > 0) {
            // 后台-页面设置-数据周期
            $where['lastupdate']    =   array('>', strtotime('-'.$this->config['sy_datacycle'].' day'));
        }
 
        if ($_POST['cycle']) {
 
            $where['billing_cycle'] =   $_POST['cycle'];
        }
 
        if ($_POST['provinceid']) {
 
            $where['provinceid']    =   $_POST['provinceid'];
        }
 
        if ($_POST['cityid']) {
 
            $where['cityid']        =   $_POST['cityid'];
        }
 
        if ($_POST['three_cityid']) {
 
            $where['three_cityid']  =   $_POST['three_cityid'];
        }
 
        if ($_POST['type']) {
 
            $where['type']          =   $_POST['type'];
        }
 
        if ($_POST['keyword']) {
 
            $keyword                =   $this->stringfilter($_POST['keyword']);
            $where['name']          =   array('like', $keyword);
        }
 
        if (!empty($_POST['did'])) {
 
            $domain =   $this->getDomain($_POST['did'], true);
 
            if (isset($domain['didcity'])) {
 
                if (!empty($domain['provinceid'])) {
                    $where['provinceid']    =   $domain['provinceid'];
                }
                if (!empty($domain['cityid'])) {
                    $where['cityid']        =   $domain['cityid'];
                }
                if (!empty($domain['three_cityid'])) {
                    $where['three_cityid']  =   $domain['three_cityid'];
                }
                $data['didcity']            =   $domain['didcity'];
                $data['cityone']            =   $domain['cityone'];
                $data['citytwo']            =   $domain['citytwo'];
                $data['citythree']          =   $domain['citythree'];
                $data['provinceid']         =   !empty($domain['provinceid']) ? intval($domain['provinceid']) : 0;
                $data['cityid']             =   !empty($domain['cityid']) ? intval($domain['cityid']) : 0;
                $data['three_cityid']       =   !empty($domain['three_cityid']) ? intval($domain['three_cityid']) : 0;
            }
        }
        $where['orderby']                   =   array('lastupdate,desc');
 
        $page   =   $_POST['page'];
 
        if ($_POST['limit']) {
 
            $limit  =   $_POST['limit'];
            if ($page) {
                $pagenav        =   ($page - 1) * $limit;
                $where['limit'] =   array($pagenav, $limit);
            } else {
                $where['limit'] =   $limit;
            }
        }
 
        $rows           =   $partM->getList($where);
 
        $data['list']   =   count($rows) ? $rows : array();
 
        if (isset($_POST['provider'])) {
            if ($_POST['provider'] == 'baidu' || $_POST['provider'] == 'weixin' || $_POST['provider'] == 'toutiao') {
                $seo            =   $this->seo('part_index', '', '', '', false, true);
                $data['seo']    =   $seo;
            }
        }
        $this->render_json(0, '', $data);
    }
 
    function show_action()
    {
 
        $msg    =   '';
        if ($this->config['sy_part_web'] == '2') {
 
            $msg    =   '很抱歉!该模块已关闭!';
            $error  =   0;
        }
        $id     =   (int)$_POST['id'];
 
        if ($msg == '') {
            if ($_POST['token'] && $_POST['uid']) {
 
                $user       =   $this->yzToken((int)$_POST['uid'], $_POST['token']);
                $uid        =   $user['uid'];
                $usertype   =   $user['usertype'];
            }
 
            if ($id) {
                $partM      =   $this->MODEL('part');
                $info       =   $partM->getInfo(array('id' => $id), array('cache' => 1, 'com' => 1, 'utype' => 'wxapp', 'uid' => $uid, 'usertype' => $usertype));
 
                $job        =   $info['info'];
 
                $morning    =   $info['cache']['part_morning'];
                $noon       =   $info['cache']['part_noon'];
                $afternoon  =   $info['cache']['part_afternoon'];
 
                $job['com_name']    =   $info['com']['name'];
 
                if (!empty($job['x']) && !empty($job['y'])) {
 
                    $coordinates    =   $this->Convert_BD09_To_GCJ02($job['x'], $job['y']);
                    $job['x']       =   $coordinates['lng'];
                    $job['y']       =   $coordinates['lat'];
                }
 
                $partM->upInfo(array('hits' => array('+', 1)), array('id' => $id)); // 更新浏览次数
 
                if ($usertype == 1) {
 
                    $apply      =   $partM->getPartSqInfo(array('uid' => $uid, 'jobid' => $id));
                    $collect    =   $partM->getPartCollectInfo(array('uid' => $uid, 'jobid' => $id));
                }
                if ($job['worktime_n']) {
                    foreach ($morning as $v) {
                        if (in_array($v, $job['worktime_n'])) {
                            $job['morning'][$v] = 1;
                        } else {
                            $job['morning'][$v] = 0;
                        }
                    }
                    foreach ($noon as $v) {
                        if (in_array($v, $job['worktime_n'])) {
                            $job['noon'][$v] = 1;
                        } else {
                            $job['noon'][$v] = 0;
                        }
                    }
                    foreach ($afternoon as $v) {
                        if (in_array($v, $job['worktime_n'])) {
                            $job['afternoon'][$v] = 1;
                        } else {
                            $job['afternoon'][$v] = 0;
                        }
                    }
                }
                $job['apply']   =   !empty($apply) ? 1 : 0;
                $job['collect'] =   !empty($collect) ? 1 : 0;
 
                if (isset($_POST['provider'])) {
                    if ($_POST['provider'] == 'app') {
 
                        $job['shareData'] = array(
                            'url'       =>  Url('wap', array('c' => 'part', 'a' => 'show', 'id' => $id)),
                            'title'     =>  $job['name'],
                            'summary'   =>  mb_substr(strip_tags($job['content']), 0, 30, 'UTF8'),
                            'imageUrl'  =>  checkpic($this->config['sy_wx_sharelogo'])
                        );
                    }
                    if ($_POST['provider'] == 'baidu' || $_POST['provider'] == 'weixin' || $_POST['toutiao']) {
                        $seoData['part_name']   =   $job['name'];
                        $this->data             =   $seoData;
                        $seo                    =   $this->seo('part_show', '', '', '', false, true);
                        $job['seo']             =   $seo;
                    }
                }
                $error = 1;
            } else {
                $msg    =   '该兼职暂无法展示!';
                $error  =   0;
            }
        }
 
        $info   =   count($job) ? $job : array();
        $this->render_json($error, $msg, $info);
    }
 
    function apply_action()
    {
 
        $user       =   $this->yzToken((int)$_POST['uid'], $_POST['token']);
        $uid        =   $user['uid'];
        $usertype   =   $user['usertype'];
 
        $partM      =   $this->MODEL('part');
        $jobid      =   (int)$_POST['jobid'];
 
        $data       =   array(
            'uid'       =>  $uid,
            'usertype'  =>  $usertype,
            'jobid'     =>  $jobid,
            'port'      =>  $_POST['codelPlat'] == 'mini' ? '3' : '4'
        );
 
        $return     =   $partM->addPartSq($data);
 
        $this->render_json($return['status'], $return['msg']);
 
    }
 
    function fav_action()
    {
 
        $user       =   $this->yzToken((int)$_POST['uid'], $_POST['token']);
        $uid        = $user['uid'];
        $usertype   =   $user['usertype'];
 
        $partM      =   $this->MODEL('part');
 
        $jobid      =   (int)$_POST['jobid'];
        $comid      =   (int)$_POST['comid'];
 
        $data       =   array(
 
            'uid'       =>  $uid,
            'usertype'  =>  $usertype,
            'jobid'     =>  $jobid,
            'comid'     =>  $comid
        );
 
        $return     =   $partM->addPartCollect($data);
        $this->render_json($return['status'], $return['msg']);
    }
}
 
?>