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.
 
 
 
 
 
 

25 lines
684 B

<?php
error_reporting(0);
include '../DB.php';
try {
$conn = new DB();
if ($conn) {
$date = date('Y-m-d'); //当前时间
$sql = "SELECT distinct(latitude),longitude,customerid,create_at from facility ORDER BY create_at desc";
$result = $conn->getAll($sql);
for($i=0;$i<sizeof($result);$i++){
$account_id= $result[$i]['customerid'];
$accountsql="SELECT * from account where accountid='$account_id'";
$accountinfo=$conn->getRow($accountsql);
$result[$i]['name']= $accountinfo['name'];
}
echo json_encode($result);
}
} catch (Exception $e) {
die($e->getMessage());
}