<?php
header("Access-Control-Allow-Origin: *"); // 允许任意域名发起的跨域请求
$peopleId = $_POST['peopleId'];
include("connectDB.php");
$cc = " AND peopleId
= '$peopleId' ";
$dd = "order by id desc";
if ($peopleId == "") {
$sequery = "SELECT * FROM order
WHERE 1=1 ".$dd ;
}else{
$sequery = "SELECT * FROM order
WHERE 1=1 ".$cc.$dd ;
}
$result = mysqli_query($dbc,$sequery) or die("Error query");
$i = 0;
while($row = mysqli_fetch_array($result)){
$resArr['id'] = $row['id'];
$resArr['userName'] = $row['userName'];
$resArr['phone'] = $row['phone'];
$resArr['type'] = $row['type'];
$resArr['school'] = $row['school'];
$resArr['day'] = $row['day'];
$resArr['num'] = $row['num'];
$resArr['peopleId'] = $row['peopleId'];
$resArr['peopleName'] = $row['peopleName'];
$data['content_data'][$i++] = $resArr;
}
mysqli_close($dbc);
echo json_encode($data);
?>