GetRevenue.php 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  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. // 查询revenue表,找到符合条件的数据并输出给前端
  8. $sql = "SELECT * FROM revenue WHERE (account = '$proxy_acc') AND oder_sta = 3 ORDER BY ID DESC";
  9. $result = mysqli_query($con, $sql);
  10. if ($result && mysqli_num_rows($result) > 0) {
  11. $data = array();
  12. while ($rows = mysqli_fetch_assoc($result)) {
  13. $oderid = $rows["oderid"];
  14. $name = $rows['name'];
  15. $odersta = $rows['oder_sta'];
  16. $type = $rows['type'];
  17. $price = $rows['price'];
  18. $state = $rows['state'];
  19. $notes = $rows['beizhu'];
  20. $crtime = date('Y-m-d H:i:s', $rows['cr_time']);
  21. $dztime = date('Y-m-d H:i:s', $rows['dz_time']);
  22. $data[] = array(
  23. "account" => $rows['account'],
  24. "oderid" => $oderid,
  25. "name" => $name,
  26. "odersta" => $odersta,
  27. "type" => $type,
  28. "price" => $price,
  29. "status" => $state,
  30. "notes" => $notes,
  31. "crtime" => $crtime,
  32. "dztime" => $dztime,
  33. );
  34. }
  35. echo json_encode($data);
  36. } else {
  37. echo json_encode(array("error" => "没有符合条件的数据"));
  38. }