Commit 29ac4f47 authored by zw's avatar zw

最适合业态

parent b45f35ae
......@@ -116,7 +116,11 @@ class MapFindHouse extends Basic
$result = $disc_arr;
} elseif ($params["grade"] == 2) {
$businessModel = new GBusinessDistrict();
$result = $businessModel->getListByMap($params["city"]);
$str = " a.city = '".$params["city"]."' ";
if($params["source"] == 2){
$str .= " and b.status = 1 and b.is_show = 0";
}
$result = $businessModel->getListByMap($str);
}
return $this->response("200", "success", $result);
}
......
......@@ -34,10 +34,10 @@ class GBusinessDistrict extends BaseModel
return $result;
}
public function getListByMap($city){
public function getListByMap($params){
$sql = "select a.id,a.`name`,a.longitude,a.latitude,count(b.id) as num
from g_business_district as a left join g_houses as b on b.business_district_id=a.id
where a.city='".$city."' and a.longitude <> '' GROUP BY b.business_district_id HAVING num > 0";
where $params and a.longitude <> '' GROUP BY b.business_district_id HAVING num > 0";
return $this->query($sql);
}
......
......@@ -1611,7 +1611,7 @@ class GHouses extends BaseModel
->where($params)
->group("a.disc")
->select();
//echo $this->getLastSql();
echo $this->getLastSql();
return $result;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment