【调度系统】广东民航医疗快线调度系统源代码
wanglizhong
2025-04-22 72c0df785d4838d35dc694071c61e3f9a54e7e81
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
<?php include "../inc/odbc.php"; ?>
<?php
$QR_type = !empty($_REQUEST["QR_type"])?$_REQUEST["QR_type"]:"1";
 
//生成用户个人二维码参数
$UserID = !empty($_REQUEST["UserID"])?$_REQUEST["UserID"]:"";
if ( !empty($UserID) ) {
    $method="UserCodeScene";
    $arr = array('method'=>$method,"APPID"=>$APPID,"UserID"=>$UserID,"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/v3/User/?'.$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){
        $UserScene = $api_info["scene"];
    }
    //echo $UserScene;exit;
}
 
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/v3/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_appid;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";
        if (empty($scene) and !empty($UserScene)){$scene=$UserScene;}
        $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;
        }
        // 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;
    }
}
 
 
 
 
 
?>