|
- <?php
- require_once "../Common/Config.php";
- $openid=$_COOKIE['wxopenid'];
- $sql="APP_MEMBER_LINKER_GET_LIST '{$openid}'";
- $pdo = new PDO("sqlsrv:Server=".HOST.";Database=".DB, USER, PASSWORD);//5.6版本pdo连接sqlsrv
- $result=$pdo->query($sql);
- $rowset = $result->fetchAll(PDO::FETCH_ASSOC);
- $linker_count=$rowset[0]["LINKER_COUNT"];
- $data=array(
- "code"=>$rowset[0]["ERRCODE"],
- "info"=>$rowset[0]["ERRINFO"]
- );
- if ($linker_count >0){
- foreach ($rowset as $v){
- $val=array();
- $val["customer_id"]=$v["ID"];
- $val["customer_name"]=$v["CUSTOMER_NAME"];
- $val["customer_mobile"]=$v["CUSTOMER_MOBILE"];
- $val["customer_idtype"]=$v["CUSTOMER_ID_TYPE"];
- $val["customer_idno"]=$v["CUSTOMER_ID_NO"];
- $data["customer"][]=$val;
- }
- }
- echo json_encode($data);
|