Proxy.php 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. <?php
  2. session_start();
  3. include_once("../../untils/conn.php");
  4. mysqli_query($con, "set names utf8");
  5. // 获取当前正在登录的账号信息的代理
  6. $proxy_acc = $_SESSION["account"];
  7. // 查询代理的所有信息字段
  8. $sql = "SELECT * FROM `proxy` WHERE `proxy_acc`='$proxy_acc'";
  9. $result = mysqli_query($con, $sql);
  10. // 构建 JSON 数据并输出给前端
  11. $data = array();
  12. if(mysqli_num_rows($result) > 0) {
  13. while($row = mysqli_fetch_assoc($result)) {
  14. $proxy_acc = $row['proxy_acc'];
  15. $proxy_phone = $row['proxy_phone'];
  16. $proxy_name = $row['proxy_name'];
  17. $proxy_img = $row['proxy_img'];
  18. $proxy_rename = $row['proxy_rename'];
  19. $proxy_uid = $row['proxy_uid'];
  20. $proxy_alipay =$row ['proxy_alipay'];
  21. $proxy_alipay_acc = $row ['proxy_alipay_acc'];
  22. $proxy_yihname = $row ['proxy_yihname'];
  23. $proxy_yihnum = $row['proxy_yhnum'];
  24. $proxy_bank_name = $row['proxy_bank_name'];
  25. $proxy_bank_zh = $row['proxy_bank_zh'];
  26. $proxy_rename_sta = $row['proxy_rename_sta'];
  27. $proxy_sta = $row['proxy_sta'];
  28. $proxy_type = $row['proxy_type'];
  29. // $proxy_intcode = $row['proxy_intcode'];
  30. // 将代理名和代理头像添加到数据数组中
  31. $data["name"] = $proxy_name;
  32. $data["avatar"] = $proxy_img;
  33. $data["account"] = $proxy_acc;
  34. $data["phone"] = $proxy_phone;
  35. $data["rename"] = $proxy_rename;
  36. $data["card_uid"] = $proxy_uid;
  37. $data["alipay"] = $proxy_alipay;
  38. $data["alipay_acc"] = $proxy_alipay_acc;
  39. $data["bank_name"] = $proxy_yihname;
  40. $data["bank_acc"] = $proxy_yihnum;
  41. $data["proxy_bank_name"] = $proxy_bank_name;
  42. $data["proxy_bank_zh"] = $proxy_bank_zh;
  43. $data["rename_sta"] = $proxy_rename_sta;
  44. $data["stauts"] = $proxy_sta;
  45. $data["puid"] = $proxy_puid;
  46. $data["type"] = $proxy_type;
  47. }
  48. }
  49. // 将数据数组转换为 JSON 格式并输出
  50. echo json_encode($data);
  51. ?>