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
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
342
343
344
345
<?php
 
class once_controller extends common{
    function index_action(){
        if($this->config['sy_once_web']=="2"){
            $this->ACT_msg_wap('index.php','很抱歉!该模块已关闭!', 1, 3);
        }
        
        $CacheM        =    $this->MODEL('cache');
        $CacheArr    =    $CacheM->GetCache(array('city'));
        $this->yunset($CacheArr);
        
        foreach($_GET as $k=>$v){
            if($k!=""){
                $searchurl[]    =    $k."=".$v;
            }
        }
        $searchurl=@implode("&",$searchurl);
        $this->yunset("searchurl",$searchurl);
        
        $onceM        =    $this->MODEL('once');
        
        $ip            =    fun_ip_get();
        $start_time    =    strtotime(date('Y-m-d 00:00:00')); //开始时间
        $totalMessNum = $onceM->getOnceNum(array('ctime'=>array('>',$start_time)));//当天总的已发布量
        $mess        =    $onceM->getOnceNum(array('login_ip'=>$ip,'ctime'=>array('>',$start_time)));
        if($this->config['sy_once_totalnum'] == 0 || ($this->config['sy_once_totalnum'] > $totalMessNum)){
            $isFb = true;
        }else{
            $isFb = false;
        }
        $this->yunset('isFb',$isFb);
        if($this->config['sy_once'] > 0){
            $num    =    $this->config['sy_once']-$mess;
        }else{
            $num    =    1;
        }
        $this->yunset("num",$num);
        $adtime    =    array("0"=>"不限","7"=>"一周以内","15"=>"半个月","30"=>"一个月","60"=>"两个月","180"=>"半年","365"=>"一年");
        $this->yunset("adtime",$adtime);
        $this->yunset('backurl', Url('wap'));
        $this->get_moblie();
        $this->seo("once");
        $this->yunset("topplaceholder","请输入招聘关键字,如:服务员...");
        $this->yunset("headertitle","店铺招聘");
        $this->yuntpl(array('wap/once'));
    }
    //短信验证
    function sendmsg_action(){
        $noticeM    =    $this->MODEL('notice');
        $result        =    $noticeM->jycheck($_POST['authcode'],'店铺招聘');
        if(!empty($result)){
            echo json_encode(array('msg'=>$result['msg'],'error'=>$result['error']));
            return;
        }
        $moblie = $_POST['moblie'];
 
        $result = $noticeM->sendCode($moblie, 'cert', 2, array(), 6, 120, 'msg');
        echo json_encode($result);
        exit();
    }
    function add_action(){ 
        if($this->config['sy_once_web']=="2"){
            $this->ACT_msg_wap('index.php','很抱歉!该模块已关闭!', 1, 3);
        }
         $ip        =    fun_ip_get();
        $this->yunset("ip",$ip);
        $CacheM        =    $this->MODEL('cache');
        $CacheList    =    $CacheM->GetCache(array('city'));
        $this->yunset($CacheList);
        $onceM    =    $this->MODEL('once');
        if((int)$_GET['id']){
            $id        =    (int)$_GET['id'];
            $row    =    $onceM->getOnceInfo(array('id'=>$id));
            if(!empty($row)){
            //检测当前密码是否对应
                session_start();
                
                if($row['password'] == $_SESSION['oncepass']){
                    $this->yunset('row',$row);
                }else{
                    
                    header("Location:".Url('wap',array('c'=>'once','a'=>'show','id'=>$id)));
                    exit();
                }
            }
        }else{
            if($this->config['once_pay_price']!="0" && $this->config['once_pay_price']!="" && $_COOKIE['fast']){
                //未付款订单
                $companyorderM    =    $this->MODEL('companyorder');
                $orderNum         =     $companyorderM->getCompanyOrderNum(array('order_state'=>1,'type'=>25,'fast'=>$_COOKIE['fast']));
                $this->yunset("num",$orderNum);
            }
        }
        
        if($_POST['submit']){
            $authcode    =    $_POST['authcode'];
            
            if($_POST['edate']){
                $edate        =    strtotime("+".(int)$_POST['edate']." days");
            }
                    
            $post        =   array(
                'title'         =>  $_POST['title'],
                'companyname'    =>  $_POST['companyname'],
                'linkman'        =>    $_POST['linkman'],
                'phone'         =>  $_POST['phone'],
                'provinceid'     =>  $_POST['provinceid'],
                'cityid'         =>  $_POST['cityid'],
                'three_cityid'    =>  $_POST['three_cityid'],
                'address'         =>  $_POST['address'],
                'require'         =>  $_POST['require'],
                'base'            =>    $_POST['preview'],
                'edate'            =>    $edate,
                'edate1'        =>    $_POST['edate'],
                'salary'        =>    $_POST['salary'],
                'password'        =>    $_POST['password'],
                'status'         =>  $this->config['com_fast_status'],
                'ctime'            =>    time(),
                'did'            =>    $this->userdid ? $this->userdid : $this->config['did'],
                'login_ip'        =>    fun_ip_get()
            );
            $data        =    array(
                'id'                =>    (int)$_POST['id'],
                'post'                =>    $post,
                'authcode'            =>    $authcode,
                'moblie_code'        =>    $_POST['moblie_code'],
                'verify_token'        =>    $_POST['verify_token'],
                'fast'                =>    $_COOKIE['fast'],
                'utype'                =>    'wap'
            );
            
            $return      =     $onceM  ->  addOnceInfo($data);
            
            echo json_encode($return);die;
        }
        
        $this->get_moblie();
        
        $this->yunset("headertitle","店铺招聘");
        $this->yunset("title","添加店铺招聘");
        $this->yuntpl(array('wap/once_add'));
    }
    function show_action(){
        if($this->config['sy_once_web']=="2"){
            $this->ACT_msg_wap('index.php','很抱歉!该模块已关闭!', 1, 3);
        }
        
        $onceM    =    $this->MODEL('once');
        $id        =    (int)$_GET['id'];
        $onceM->upOnce(array('hits'=>array('+',1)),array('id'=>$id));
        
        $row    =    $onceM->getOnceInfo(array('id'=>$id));
        
        if($row['status']<1  && !$_GET['pay']){
            $this->ACT_msg_wap(Url('wap',array('c'=>'once')),'店铺正在审核!', 1, 3);
            
        }elseif($row['pay']=='1' && !$_GET['pay']){
            $this->ACT_msg_wap(Url('wap',array('c'=>'once')),'店铺招聘付费中!', 1, 3);
        }
        $this->yunset("row",$row);
        
        $data['once_job']    =    $row['title'];
        $data['once_name']    =    $row['companyname'];
        $description        =    $row['require_n'];
        $data['once_desc']    =    $this->GET_content_desc($description);
        $this->data            =    $data;
        $this->seo('once_show');
        $CacheM        =    $this->MODEL('cache');
        $CacheList    =    $CacheM->GetCache(array('city'));
        $this->yunset($CacheList);
        $this->get_moblie();
        $this->yunset("headertitle","店铺招聘");
        $this->yuntpl(array('wap/once_show'));
    }
    
    function pay_action(){
        if($this->config['sy_once_web']=="2"){
            $this->ACT_msg_wap('index.php','很抱歉!该模块已关闭!', 1, 3);
        }
        $onceM    =    $this->MODEL('once');
        $row    =    $onceM->getOnceInfo(array('id'=>(int)$_GET[id]));
        if($_GET['id']){
            
            if(!$row){
                $this->ACT_msg_wap(Url('wap',array('c'=>'once')),'店铺信息不存在!', 1, 3);
            }
        }
        
        if($this->config['wxpay']=='1'){
            $paytype['wxpay']    =    '1';
        }
        if($this->config['alipay']=='1' &&  $this->config['alipaytype']=='1'){
            $paytype['alipay']    =    '1';
        }
        if($paytype){
            $this->yunset("paytype",$paytype);
        }
        
        $data['once_job']    =    $row['title'];
        $data['once_name']    =    $row['companyname'];
        $description        =    $row['require_n'];
        $data['once_desc']    =    $this->GET_content_desc($description);
        $this->data            =    $data;
         $this->seo('once_show');
        
        $this->get_moblie();
        
        $this->yunset("headertitle","店铺招聘");
        $this->yuntpl(array('wap/once_pay'));
    }
    
    function getOrder_action(){
        
        if($_POST){
            $onceM    =    $this->MODEL('once');
            $data    =    array(
                'id'            =>    $_POST['id'],
                'did'            =>    $this->userdid,
                'pay_type'        =>    $_POST['paytype'],
                'once_price'    =>    $_POST['once_price'],
            );
            $return    =    $onceM->payOnce($data);
            if($return['id']){
                
                if($_POST['paytype']=='alipay'){
                    
                    
                    $dingdan    =    $return['orderid'];
                    $price        =    $this->config['once_pay_price'];
                    $url        =    $this->config['sy_weburl'].'/api/wapalipay/alipayto.php?dingdan='.$dingdan.'&dingdanname='.$dingdan.'&alimoney='.$price;
                    
                }else if($_POST['paytype']=='wxpay'){
                    
                    if($this->config['sy_wapdomain']){
                        $url    =   $this->config['sy_wapdomain'].'/index.php?c=once&a=wxpay&id='.$return['oid'];
                    }else{
                        $url    =   $this->config['sy_weburl'].'/wap/index.php?c=once&a=wxpay&id='.$return['oid'];
                    }
                     
                }
                header('Location: '.$url);exit();
            }else{
                $data['msg']    =    '提交失败!!';
                $data['url']    =    Url('wap',array('c'=>'once'));
                $this->ACT_msg_wap($data['url'],$data['msg'], 1, 3);
            }
            
        }
    }
    
    function wxpay_action(){
        if($_GET['id']){
            $id             =     (int)$_GET['id'];
            $companyorderM    =    $this->MODEL('companyorder');
            $order             =    $companyorderM->getInfo(array('id'=>$id));
            
            if(!empty($order)){
                require_once(LIB_PATH.'wxOrder.function.php');
                //判断是否来源于weixin
                if(!is_weixin()){
                    $jsApiParameters         =     wxWapOrderMweb(array('body'=>'充值','id'=>$order['order_id'],'url'=>$this->config['sy_weburl'],'total_fee'=>$order['order_price']));
                    
                    if($jsApiParameters['mweb_url']){
                        //代付款页面
                        header('Location: '.$jsApiParameters['mweb_url'].'&redirect_url='.urlencode($this->config['sy_wapdomain'].'/index.php?c=once'));
                        exit();
                    }else{
                        if($jsApiParameters['err_code_des']){
                            $data['msg']    =    $jsApiParameters['err_code_des'];
                        }elseif($jsApiParameters['return_msg']){
                            $data['msg']    =    $jsApiParameters['return_msg'];
                        }else{
                            $data['msg']    =    '支付失败';
                        }
                         $data['url']        =    Url('wap',array('c'=>'once','a'=>'paylog'));
                         $this->ACT_msg_wap($data['url'],$data['msg'], 1, 3);
                    }
                }else{
                    $jsApiParameters         =     wxWapOrder(array('body'=>'充值','id'=>$order['order_id'],'url'=>$this->config['sy_weburl'],'total_fee'=>$order['order_price']));
                    
                    if($jsApiParameters){
                        $this->yunset('jsApiParameters',$jsApiParameters);
                    }else{
                        $data['msg']        =    "支付失败,请重新支付!";
                         $data['url']        =    Url('wap',array('c'=>'once','a'=>'paylog'));//订单页面
                         $this->ACT_msg_wap($data['url'],$data['msg'], 1, 3);
                    }
                }
            }else{
                $data['msg']    =    "参数不正确,请正确填写!";
                $data['url']    =    $_SERVER['HTTP_REFERER'];
                $this->ACT_msg_wap($data['url'],$data['msg'], 1, 3);
            }
            $this->yunset('id',(int)$_GET['id']);
 
            $this->yuntpl(array('wap/wxpay'));
 
        }else{
            $data['msg']="参数不正确,请正确填写!";
            $data['url']=$_SERVER['HTTP_REFERER'];
            $this->ACT_msg_wap($data['url'],$data['msg'], 1, 3);
 
             $this->yuntpl(array('wap/wxpay'));
 
        }
    }
    
    function paylog_action(){
        $companyorderM    =    $this->MODEL('companyorder');
        $rows             =     $companyorderM->getList(array('order_state'=>1,'type'=>25,'fast'=>$_COOKIE['fast']));
        
        $this->yunset("rows",$rows);
            
        $this->yunset("headertitle","待付款店铺");
        $this->seo('once');
        $this->yuntpl(array('wap/once_paylog'));
    }
    
    function delpaylog_action(){
        $orderM    =    $this->MODEL('companyorder');
        $return    =    $orderM->del((int)$_GET['id'],array('utype'=>'once'));
        if($return['errcode']==9){
            $return['msg']='取消订单成功!';
        }else{
            $return['msg']='取消订单失败!';
        }
        $this->layer_msg($return['msg'],$return['errcode'],$return['layertype'],$_SERVER['HTTP_REFERER']);
    }
    function ajax_action(){
        $onceM        =    $this->MODEL('once');
        $data        =    array(
            'code'        =>    $_POST['checkcode'],
            'id'        =>    (int)$_POST['id'],
            'password'    =>    $_POST['password'],
            'type'        =>    $_POST['operation_type'],
            'utype'        =>    'wap'
            
        );
        $return        =    $onceM -> setOncePassword($data);
        
        echo json_encode($return);die;
    }
}
?>