Commit e65ce33c authored by clone's avatar clone

楼盘删选

parent 2d599ab7
...@@ -15,6 +15,7 @@ use app\model\GLabels; ...@@ -15,6 +15,7 @@ use app\model\GLabels;
use app\model\HouseImgs; use app\model\HouseImgs;
use app\model\HouseInfos; use app\model\HouseInfos;
use app\model\Labels; use app\model\Labels;
use app\model\Regions;
class Shop extends Basic class Shop extends Basic
{ {
...@@ -211,32 +212,26 @@ class Shop extends Basic ...@@ -211,32 +212,26 @@ class Shop extends Basic
*/ */
public function filtrateCondition() public function filtrateCondition()
{ {
$field = "city,disc";
$param['id'] = array( '<>', 16 );
$param['room_num_left'] = array( '<>', 0 );
$group_ = "disc";
$cityList = $this->db->getCityList($field, $param, $group_);
foreach ($cityList as $k => $v) { $regions = new Regions();
if (!empty($v["city"])) { $cityList = $regions->getRegionsCitySH();
$cityArr[] = $v["city"];
}
}
$cityArr = array_unique($cityArr);
$i = 0; $i = 0;
$result["area"][$i]["city"] = "全部"; $result["area"][$i]["city"] = "全部";
$result["area"][$i]["disc"][] = "全部"; $result["area"][$i]["disc"][] = "全部";
foreach ($cityArr as $key => $val) { foreach ($cityList as $k => $v) {
$i++; $i++;
$result["area"][$i]["city"] = $val; if (!empty($v["name"])) {
$result["area"][$i]["disc"][] = "全" . $val; $result["area"][$i]["city"] = $v["name"];
foreach ($cityList as $k => $v) { $result["area"][$i]["disc"][] = "全" . $v["name"];
if ($val == $v["city"]) { }
$result["area"][$i]["disc"][] = $v["disc"]; foreach ($v["city"] as $item) {
if (!empty($item)) {
$result["area"][$i]["disc"][] = $item;
} }
} }
} }
$result['yetai'] = array( '全部', '餐饮美食', '百货零售', '休闲娱乐', '其他' ); $result['yetai'] = array( '全部', '餐饮美食', '百货零售', '休闲娱乐', '其他' );
//租金租金(0:租金-大于三万; 1:租金一万到三万之间; 2:租金-小于一万) //租金租金(0:租金-大于三万; 1:租金一万到三万之间; 2:租金-小于一万)
......
...@@ -83,6 +83,23 @@ class Regions extends Model ...@@ -83,6 +83,23 @@ class Regions extends Model
return $data; return $data;
} }
/**
* 获取沪城市和区
*
* @return array
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public function getRegionsCitySH() {
$data = [];
$city_data = $this->field('code,fullName')->where('parentCode in ( 310000)')->select();
foreach ($city_data as $k=>$v) {
$data[$k]['name'] = $v['fullName'];
$data[$k]['city'] = $this->where('parentCode',$v['code'])->column('fullName');
}
return $data;
}
/** /**
* 根据区code获取省市区中文 * 根据区code获取省市区中文
* *
......
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