Commit 26cf7b92 authored by zw's avatar zw

地图找铺

parent d0685195
...@@ -52,6 +52,11 @@ class MapFindHouse extends Basic ...@@ -52,6 +52,11 @@ class MapFindHouse extends Basic
return $this->response("101", "坐标传入有误"); return $this->response("101", "坐标传入有误");
} }
$conditions = []; $conditions = [];
$source = $params["source"];
if($source == 2){
$conditions['status'] = array('eq', 1); //只显示上架
$conditions['is_show'] = array('eq', 0); //c端只显示可显示的楼盘
}
$conditions["latitude"] = array("between", array($second_spot_arr[0], $first_spot_arr[0])); $conditions["latitude"] = array("between", array($second_spot_arr[0], $first_spot_arr[0]));
$conditions["longitude"] = array("between", array($second_spot_arr[1], $first_spot_arr[1])); $conditions["longitude"] = array("between", array($second_spot_arr[1], $first_spot_arr[1]));
...@@ -91,7 +96,13 @@ class MapFindHouse extends Basic ...@@ -91,7 +96,13 @@ class MapFindHouse extends Basic
$disc_str .= $item["name"] . ","; $disc_str .= $item["name"] . ",";
} }
$disc_str = rtrim($disc_str, ","); $disc_str = rtrim($disc_str, ",");
$shop_arr = $this->gHousesModel->getHouseNumByDisc($disc_str); $params["a.disc"] = array("in",$disc_str);
if($params["source"] == 2){
$params['a.status'] = array('eq', 1); //只显示上架
$params['a.is_show'] = array('eq', 0); //c端只显示可显示的楼盘
}
$shop_arr = $this->gHousesModel->getHouseNumByDisc($params);
$disc_arr = []; $disc_arr = [];
foreach ($disc as $key => $item) { foreach ($disc as $key => $item) {
foreach ($shop_arr as $i => $j) { foreach ($shop_arr as $i => $j) {
......
...@@ -60,6 +60,8 @@ class Basic extends Controller ...@@ -60,6 +60,8 @@ class Basic extends Controller
"broker/addUserCallAgentV2", "broker/addUserCallAgentV2",
"broker/addSpreadUser", "broker/addSpreadUser",
"broker/getVolume", "broker/getVolume",
"broker/getCityInfoByMap",
"broker/getShopListByMap",
); );
/** /**
......
...@@ -1598,14 +1598,13 @@ class GHouses extends BaseModel ...@@ -1598,14 +1598,13 @@ class GHouses extends BaseModel
} }
/** /**
* @param $disc_str * @param $params
* @return false|\PDOStatement|string|\think\Collection * @return false|\PDOStatement|string|\think\Collection
* @throws \think\db\exception\DataNotFoundException * @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException * @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException * @throws \think\exception\DbException
*/ */
public function getHouseNumByDisc($disc_str){ public function getHouseNumByDisc($params){
$params["a.disc"] = array("in",$disc_str);
$result = Db::table($this->table) $result = Db::table($this->table)
->field("a.id,a.disc,count(1) as num") ->field("a.id,a.disc,count(1) as num")
->alias("a") ->alias("a")
......
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