Commit f7ac77d6 authored by zw's avatar zw

地图找房

parent a3b809e2
...@@ -69,12 +69,12 @@ class MapFindHouse extends Basic ...@@ -69,12 +69,12 @@ class MapFindHouse extends Basic
public function getCityInfoByMap() public function getCityInfoByMap()
{ {
$params = $this->params; $params = $this->params;
/* $params = array( /* $params = array(
"spot" => "1223,1213123", "spot" => "1223,1213123",
"grade" => 2,//1 区,2商圈,3街道 "grade" => 1,//1 区,2商圈,3街道
"source" => 1,//来源 1b端,2c端 "source" => 1,//来源 1b端,2c端
"city" => "上海市"//传城市就好了 "city" => "上海市"//传城市就好了
);*/ );*/
$checkResult = $this->validate($params, "MapFindHouseValidate.getCityInfoByMap"); $checkResult = $this->validate($params, "MapFindHouseValidate.getCityInfoByMap");
if (true !== $checkResult) { if (true !== $checkResult) {
return $this->response("101", $checkResult); return $this->response("101", $checkResult);
...@@ -83,23 +83,26 @@ class MapFindHouse extends Basic ...@@ -83,23 +83,26 @@ class MapFindHouse extends Basic
$conditions = []; $conditions = [];
$result = []; $result = [];
$disc = $this->regionsModel->getDiscByCity($params["city"]);
$disc_str = "";
foreach ($disc as $item) {
$disc_str .= $item["name"] . ",";
}
$disc_str = rtrim($disc_str, ",");
if ($params["grade"] == 1) { if ($params["grade"] == 1) {
$disc = $this->regionsModel->getDiscByCity($params["city"]);
$disc_str = "";
foreach ($disc as $item) {
$disc_str .= $item["name"] . ",";
}
$disc_str = rtrim($disc_str, ",");
$shop_arr = $this->gHousesModel->getHouseNumByDisc($disc_str); $shop_arr = $this->gHousesModel->getHouseNumByDisc($disc_str);
$disc_arr = [];
foreach ($disc as $key => $item) { foreach ($disc as $key => $item) {
foreach ($shop_arr as $i => $j) { foreach ($shop_arr as $i => $j) {
if ($item["name"] == $j["disc"]) { if ($item["name"] == $j["disc"]) {
$disc[$key]["num"] = $j["num"]; $disc_arr[$key] = $item;
$disc_arr[$key]["num"] = $j["num"];
} }
} }
} }
$result = $disc; $result = $disc_arr;
} elseif ($params["grade"] == 2) { } elseif ($params["grade"] == 2) {
$businessModel = new GBusinessDistrict(); $businessModel = new GBusinessDistrict();
$result = $businessModel->getListByMap($params["city"]); $result = $businessModel->getListByMap($params["city"]);
......
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