chengkun
2025-05-12 c49b17b9588306c14ad4b30e6a2c4b8644f3233b
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
<?php
 
class admin_xcx_wx_controller extends adminCommon{
    
    function index_action()
    {
        
        if($_POST['pay_config']){
            
            $wxpay['sy_wxpayappid']        =    trim($_POST['sy_wxpayappid']);
            
            $wxpay['sy_wxappsecret']    =    trim($_POST['sy_wxappsecret']);
            
            $wxpay['sy_wxpaymchid']        =    trim($_POST['sy_wxpaymchid']);
            
            $wxpay['sy_wxpaykey']        =    trim($_POST['sy_wxpaykey']);
            
            $wxpay['sy_wxpem_cert']        =    $_POST['sy_wxpem_cert'];
            
            $wxpay['sy_wxpem_key']        =    $_POST['sy_wxpem_key'];
            
            $wxpay['sy_wxpem_ca']        =    $_POST['sy_wxpem_ca'];
            
            //小程序用
            $wxpay['sy_xcxappid']        =    trim($_POST['sy_xcxappid']);
            
            $wxpay['sy_xcxsecret']        =    trim($_POST['sy_xcxsecret']);
            
            $wxpay['sy_xcxysid']        =    trim($_POST['sy_xcxysid']);
            
            $wxpay['sy_sphid']            =    trim($_POST['sy_sphid']);
            
            made_web(DATA_PATH.'api/wxpay/wxpay_data.php',ArrayToString($wxpay),'wxpaydata');
            
            $configM  =  $this->MODEL('config');
 
            $data['sy_xcxappid'] = trim($_POST['sy_xcxappid']);
            $data['sy_wxxcx_iospay']  =  isset($_POST['sy_wxxcx_iospay']) ? 1 : 2;
            $data['sy_xcx_contact']  =  isset($_POST['sy_xcx_contact']) ? 1 : 2;
            $data['sy_xcxQrcode']  =  isset($_POST['sy_xcxQrcode']) ? 1 : 2;
            
            $data['sy_xcxname'] = trim($_POST['sy_xcxname']);
 
            $data['sy_xcxpath'] = trim($_POST['sy_xcxpath']);
 
 
            $configM -> setConfig($data);
            
            $this->web_config();
            
            $this->ACT_layer_msg('微信小程序配置成功!',9,$_SERVER['HTTP_REFERER'],2,1);
        }
        
        @include(DATA_PATH.'api/wxpay/wxpay_data.php');
 
        if (isset($wxpaydata)){
            $this->yunset('wxpaydata',$wxpaydata);
        }
 
        $this->yuntpl(array('admin/admin_xcx_wx'));
    }
    
    function getQrcode_action(){
        
        if ($_GET['type']){
            
            $jobM  =  $this->MODEL('job');
            
            $job   =  $jobM->getInfo(array('state'=>1,'status'=>0,'r_status'=>1,'orderby'=>'id,desc'),array('field'=>'`id`'));
            
            if (!empty($job)){
                
                $data  =  array(
                    'type'  =>  $_GET['type'],
                    'id'    =>  $job['id']
                );
                $xcxM    =  $this->MODEL('xcx');
                
                $return  =  $xcxM->getQrcode($data);
                
                echo json_encode($return);die();
            }
        }
    }
 
}
 
?>