【调度系统】广东民航医疗快线调度系统源代码
wanglizhong
2025-06-16 ae5b0a8c63979351028215b8fe8cdf4b0766c272
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
<?php include "../inc/odbc.php"; ?>
<?php include "../inc/function.php"; ?>
<?php
function object_array($array) {  
    if(is_object($array)) {  
        $array = (array)$array;  
    } 
    if(is_array($array)) {
        foreach($array as $key=>$value) {  
            $array[$key] = object_array($value);  
        }  
    }  
    return $array;  
}
 
$postData = json_decode(file_get_contents('php://input',true),true);
 
// var_dump($postData);exit;
$num = 0;
$formID_arr = json_decode(($postData["formID"]),true);
if (isset($formID_arr)){
    foreach($formID_arr as $v){
        if(empty(object_array($v)["formID"]) || empty($postData["openId"]) || empty($postData["regiOPENID"]) || empty($postData["formID_status"]) || object_array($v)["formID"] == "the formId is a mock one"){
            $num -= 1;
        }else{
            $num += 1;
        }
        if(object_array($v)["formID"] != "the formId is a mock one"){
            $formID = object_array($v)["formID"];
            $openId = $postData["openId"];
 
            $regiOPENID = $postData["regiOPENID"];
            
            $formID_status = $postData["formID_status"];
            
            
            $insert_sql = "INSERT INTO weixinUserFormID (formID_detail,formID_openId,formID_regiOPENID,formID_status) VALUES ('$formID','$openId','$regiOPENID',$formID_status)";
            
            $res = sqlsrv_query($conn,$insert_sql);
        }
        
    }
}
if($num>0){
    $msg = array(
        "result"=>1,
        "msg"=>"成功"
    );
}else{
    $msg = array(
        "result"=>0,
        "msg"=>"失败"
    );
}
 
echo json_encode($msg,JSON_UNESCAPED_UNICODE);
 
?>