【调度系统】广东民航医疗快线调度系统源代码
hzj
2025-08-14 1ce68427c1d414c39261a26bca710fbf4fd9a6e5
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
<?php include "../inc/odbc.php"; ?>
<?php
$QR_type = !empty($_REQUEST["QR_type"])?$_REQUEST["QR_type"]:"1";
 
if ($QR_type=="1") {
    //生成小程序码
    $method="weixin_Appid";
    $arr = array('method'=>$method,"APPID"=>$APPID,"UnixTime"=>time());
    ksort($arr);
    $i=0;
    $stringA='';
    $content='';
    foreach($arr as $k=>$v){
        $stringA=$stringA.$k.$v;
        $content.="&".$k."=".$v;
    }
    $stringSignTemp=$stringA.$APPSECRET;
    $stringSignTemp=str_replace(" ", "%20", $stringSignTemp);
    $sign=MD5($stringSignTemp);
    //echo $stringSignTemp.",Sign:".$sign."<br>";
    $content = 'Sign='.$sign.$content;
    $api_url='https://api.966120.com.cn/weixin/?'.$content;
    //echo $api_url;exit;
    $api_url=str_replace(" ", "%20", $api_url);
    $api_info=file_get_contents($api_url);
    $api_info=json_decode($api_info,true);
    $result = $api_info["result"];
    if ($result==1){
        $wx_Name = $api_info["weixin_Name"];
        $wx_appid = $api_info["wx_APPID"];
        $wx_APPSECRET = $api_info["wx_APPSECRET"];
        $wx_access_token = $api_info["access_token"];
        $jsapi_ticket = $api_info["jsapi_ticket"];
        $mch_id = $api_info["mch_id"];
        $mch_key = $api_info["mch_key"];
    }
    //echo $wx_access_token;exit;
    if(!empty($wx_access_token)){
        $width = !empty($_REQUEST["width"])?$_REQUEST["width"]:"430";
        $ma_url = "https://api.weixin.qq.com/wxa/getwxacodeunlimit?access_token=$wx_access_token";
        $path = !empty($_REQUEST["path"])?str_replace("|","&",$_REQUEST["path"]):"pages/index/index";
        $page = explode("?",$path)[0];
        $scene = !empty($_REQUEST["scene"])?$_REQUEST["scene"]:"0";
        $send = array(
            "page"=>$page,
            "width"=>$width,
            "scene"=>$scene
        );
        // var_dump($send);exit;
        $send = json_encode($send);
        // var_dump($send);exit;
        $ch = curl_init();//初始化curl
        curl_setopt($ch, CURLOPT_TIMEOUT, 30);
        curl_setopt($ch, CURLOPT_URL, $ma_url);
        curl_setopt($ch, CURLOPT_SSL_VERIFYPEER,FALSE);
        curl_setopt($ch, CURLOPT_SSL_VERIFYHOST,FALSE);
        curl_setopt($ch, CURLOPT_HEADER, FALSE);
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
        curl_setopt($ch, CURLOPT_POSTFIELDS,$send);
        
        $data_save = curl_exec($ch);//运行curl
        // var_dump($data_save);exit;
        
        
        
        curl_close($ch);
        /*
        if(!empty($_REQUEST["base"])){
            echo "data:image/jpeg;base64,".base64_encode($data_save);
        }else{
            header("content-type: image/jpeg");
            echo $data_save;
        }
        */
        // 图片Base64编码字符串
        $base64String="data:image/jpeg;base64,".base64_encode($data_save);
        // 提取编码字符串中的实际数据部分
        $data = substr($base64String, strpos($base64String, ",") + 1);
        // 将Base64字符串解码为二进制数据
        $binaryData = base64_decode($data);
        // 将二进制数据保存为图片文件
        file_put_contents("QRCode/QR_".$_REQUEST["scene"].".jpg", $binaryData);
        echo "https://api.966120.com.cn/weixin/QRCode/QR_".$_REQUEST["scene"].".jpg";
        // header("content-type: image/jpeg");
 
        
            
    }
}elseif ($QR_type=="2") {
    //生成公众号带参数二维码
    $QR_Key = !empty($_REQUEST["QR_Key"])?$_REQUEST["QR_Key"]:"0";
    if(!empty($QR_Key)){
        $api_url='https://wx.966120.com.cn/wx_QRapi.asp?QR_type=4&QR_Key='.$QR_Key;
        //echo $api_url;exit;
        $api_info=file_get_contents($api_url);
        echo $api_info;
    }
}
 
 
 
 
 
?>