You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

24 lines
758 B

  1. <?php
  2. require_once "../Common/Config.php";
  3. $openid=$_COOKIE['wxopenid'];
  4. $sql="APP_MEMBER_LINKER_GET_LIST '{$openid}'";
  5. $pdo = new PDO("sqlsrv:Server=".HOST.";Database=".DB, USER, PASSWORD);//5.6版本pdo连接sqlsrv
  6. $result=$pdo->query($sql);
  7. $rowset = $result->fetchAll(PDO::FETCH_ASSOC);
  8. $linker_count=$rowset[0]["LINKER_COUNT"];
  9. $data=array(
  10. "code"=>$rowset[0]["ERRCODE"],
  11. "info"=>$rowset[0]["ERRINFO"]
  12. );
  13. if ($linker_count >0){
  14. foreach ($rowset as $v){
  15. $val=array();
  16. $val["customer_id"]=$v["ID"];
  17. $val["customer_name"]=$v["CUSTOMER_NAME"];
  18. $val["customer_mobile"]=$v["CUSTOMER_MOBILE"];
  19. $val["customer_idtype"]=$v["CUSTOMER_ID_TYPE"];
  20. $val["customer_idno"]=$v["CUSTOMER_ID_NO"];
  21. $data["customer"][]=$val;
  22. }
  23. }
  24. echo json_encode($data);