19 lines
575 B
PHP
19 lines
575 B
PHP
<?php
|
|
include_once __DIR__."/config.php";
|
|
function getEstateData($city='宁波',$fDate,$toDate){
|
|
$mysqli = get_mysqli_connection();
|
|
$sql=<<<EOF
|
|
SELECT city, listdate,sum(nums) as num FROM `estate_listing`
|
|
where listdate>='$fDate' and listdate<='$toDate' and city='$city' group by listdate
|
|
EOF;
|
|
$result = $mysqli->query($sql);
|
|
$data=array();
|
|
if($result && $result->num_rows>0) {
|
|
while($row = $result->fetch_assoc()){
|
|
array_push($data,array("value"=>array($row['listdate'],$row['num'])));
|
|
}
|
|
}
|
|
|
|
return $data;
|
|
}
|
|
?>
|