Commit ab40634f authored by clone's avatar clone

1

parent 41b62ddf
...@@ -12,9 +12,12 @@ namespace app\api_broker\controller; ...@@ -12,9 +12,12 @@ namespace app\api_broker\controller;
use app\api_broker\extend\Basic; use app\api_broker\extend\Basic;
use app\index\service\OfficeRoomService; use app\index\service\OfficeRoomService;
use app\index\service\OfficeService; use app\index\service\OfficeService;
use app\model\MetroStations;
use app\model\OfficeGBuilding; use app\model\OfficeGBuilding;
use app\model\OfficeGHousesFollowUp; use app\model\OfficeGHousesFollowUp;
use app\model\OfficeGLabels;
use app\model\OfficeGRoom; use app\model\OfficeGRoom;
use app\model\Regions;
class OfficeRoom extends Basic class OfficeRoom extends Basic
{ {
...@@ -102,9 +105,9 @@ class OfficeRoom extends Basic ...@@ -102,9 +105,9 @@ class OfficeRoom extends Basic
} }
$id = $params['id']; $id = $params['id'];
$result = $this->service->getOfficeRoomInfo($id,$this->agentId); $result = $this->service->getOfficeRoomInfo($id, $this->agentId);
return $this->response($result['status'],$result['msg'], $result['data']); return $this->response($result['status'], $result['msg'], $result['data']);
} }
/** /**
...@@ -185,7 +188,7 @@ class OfficeRoom extends Basic ...@@ -185,7 +188,7 @@ class OfficeRoom extends Basic
// ); // );
$conditions = []; $conditions = [];
$field = "a.id,b.title,b.address"; $field = "a.id,b.title,b.address";
if(empty($params["city"])){ if (empty($params["city"])) {
$conditions["b.city"] = trim($this->city); $conditions["b.city"] = trim($this->city);
} }
...@@ -193,8 +196,8 @@ class OfficeRoom extends Basic ...@@ -193,8 +196,8 @@ class OfficeRoom extends Basic
$pageNo = empty($params['pageNo']) ? 1 : $params['pageNo']; $pageNo = empty($params['pageNo']) ? 1 : $params['pageNo'];
$pageSize = empty($params['pageSize']) ? 15 : $params['pageSize']; $pageSize = empty($params['pageSize']) ? 15 : $params['pageSize'];
if (isset($params['keyword']) && !empty($params['keyword']) ) { if (isset($params['keyword']) && !empty($params['keyword'])) {
$conditions['a.id|b.title'] = array("like","%" . trim($params['keyword']) . "%"); $conditions['a.id|b.title'] = array("like", "%" . trim($params['keyword']) . "%");
} }
$order_ = "b.status asc,b.id desc"; $order_ = "b.status asc,b.id desc";
...@@ -237,7 +240,7 @@ class OfficeRoom extends Basic ...@@ -237,7 +240,7 @@ class OfficeRoom extends Basic
$m_office_building = new OfficeGBuilding(); $m_office_building = new OfficeGBuilding();
$m_office_room = new OfficeGRoom(); $m_office_room = new OfficeGRoom();
$building_id = $m_office_room->getFieldOneValue('building_id', ['id'=>$params['house_id']]); $building_id = $m_office_room->getFieldOneValue('building_id', ['id' => $params['house_id']]);
$result = $m_office_building->getFindData('province,city,disc', ['id' => $building_id]); $result = $m_office_building->getFindData('province,city,disc', ['id' => $building_id]);
if ($result) { if ($result) {
$params['province'] = $result['province'] ? $result['province'] : '上海市'; $params['province'] = $result['province'] ? $result['province'] : '上海市';
...@@ -266,9 +269,9 @@ class OfficeRoom extends Basic ...@@ -266,9 +269,9 @@ class OfficeRoom extends Basic
$params = $this->params; $params = $this->params;
$pageNo = empty($params['pageNo']) ? 1 : $params['pageNo']; $pageNo = empty($params['pageNo']) ? 1 : $params['pageNo'];
$pageSize = empty($params['pageSize']) ? 15 : $params['pageSize']; $pageSize = empty($params['pageSize']) ? 15 : $params['pageSize'];
$status = isset($params['status'])?$params['status']:1; $status = isset($params['status']) ? $params['status'] : 1;
$result = $this->service->getMyBuildingRoom($status,$pageNo, $pageSize, $this->agentId); $result = $this->service->getMyBuildingRoom($status, $pageNo, $pageSize, $this->agentId);
return $this->response($result['status'],$result['msg'], $result['data']); return $this->response($result['status'], $result['msg'], $result['data']);
} }
/** /**
...@@ -309,8 +312,8 @@ class OfficeRoom extends Basic ...@@ -309,8 +312,8 @@ class OfficeRoom extends Basic
$page_no = empty($params['page_no']) ? 1 : $params['page_no']; $page_no = empty($params['page_no']) ? 1 : $params['page_no'];
$page_size = empty($params['page_size']) ? 15 : $params['page_size']; $page_size = empty($params['page_size']) ? 15 : $params['page_size'];
if (isset($params['keyword']) && !empty($params['keyword']) ) { if (isset($params['keyword']) && !empty($params['keyword'])) {
$conditions['a.id|b.title'] = array("like","%" . trim($params['keyword']) . "%"); $conditions['a.id|b.title'] = array("like", "%" . trim($params['keyword']) . "%");
} }
$conditions['a.status'] = array('eq', 1); //只显示上架 $conditions['a.status'] = array('eq', 1); //只显示上架
...@@ -343,4 +346,103 @@ class OfficeRoom extends Basic ...@@ -343,4 +346,103 @@ class OfficeRoom extends Basic
return $this->response($this->code, $this->msg, $this->data); return $this->response($this->code, $this->msg, $this->data);
} }
/**
* @return \think\Response
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public function filtrateConditionRoom()
{
$params = $this->params;
if (empty($params["city"])) {
return $this->response("101", "参数错误");
}
$city = $params["city"];
$regions = new Regions();
$cityList = $regions->getRegionsByCity($city);
$i = $j = 0;
$result["area"][$i]["city"] = "全部";
$result["area"][$i]["disc"][] = "全部";
foreach ($cityList as $k => $v) {
$i++;
if (!empty($v["name"])) {
$result["area"][$i]["city"] = $v["name"];
$result["area"][$i]["disc"][] = "全" . $v["name"];
}
foreach ($v["city"] as $item) {
if (!empty($item)) {
$result["area"][$i]["disc"][] = $item;
}
}
if ($j == 0) {
$result["area"][$i]["business_district"][$j]['district'] = "全" . $v["name"];
$result["area"][$i]["business_district"][$j]['business'][] = [
'id' => 0, 'name' => '全部'
];
}
foreach ($v['business_district'] as $item2) {
if (!empty($item2)) {
$j++;
$result["area"][$i]["business_district"][$j] = $item2;
}
}
break;
}
$metroStations = new MetroStations();
$stationsParams["is_del"] = 0;
$stationsParams["province"] = array("like", trim($city) . "%");
$stationsField = "id,line_name,line_name_simple,name,province,city,latitude,longitude";
$stationsArr = $metroStations->getMetroStations($stationsField, $stationsParams);
$x = $y = 0;
$result["stations"][$x]["line"] = "全部";
$refer = array();
foreach ($stationsArr as $key => $value) {
$refer[$value["line_name_simple"]][] = $value;
}
foreach ($refer as $key => $data) {
$result["stations"][$x]["line"] = $key;
$result["stations"][$x]["name"] = $data;
$x++;
}
$result['yetai'] = array('全部', '商场美食', '沿街餐饮', '百货超市', '服饰鞋包', '亲子教育', '休闲娱乐', '办公', '其他');
//租金租金(0:租金-大于三万; 1:租金一万到三万之间; 2:租金-小于一万)
$result['money'] = array(
array('id' => '-1', 'value' => '全部'), array('id' => '0', 'value' => '3万以上'),
array('id' => '1', 'value' => '1万-3万'), array('id' => '2', 'value' => '1万以下')
);
//面积
$result['acreage'] = array(
array('id' => '-1', 'value' => '全部'), array('id' => '0', 'value' => '30m²以内'),
array('id' => '1', 'value' => '30-60m²'), array('id' => '2', 'value' => '60-100m²'), array('id' => '3', 'value' => '100-300m²')
, array('id' => '4', 'value' => '300-500m²'), array('id' => '5', 'value' => '500m²以上')
);
$result['more'][] = "全部";
$room_labels = new OfficeGLabels();
$labelsResult = $room_labels->getLabels();
if (count($labelsResult) > 0) {
foreach ($labelsResult as $labelsKey => $labelsVal) {
if ($labelsVal['name']) {
$result['more'][] = $labelsVal['name'];
}
}
}
return $this->response("200", "request success", $result);
}
} }
\ No newline at end of file
...@@ -362,7 +362,7 @@ class OfficeOrderLogService ...@@ -362,7 +362,7 @@ class OfficeOrderLogService
if ($father_id > 0) { //修改办公楼已租状态 if ($father_id > 0) { //修改办公楼已租状态
$orderModel = new OfficeOrderModel(); $orderModel = new OfficeOrderModel();
$houseArr = $orderModel->selectOrderByOrderId("b.id,c.type", ["order_id" => $order_id]); $houseArr = $orderModel->selectOrderByOrderId("b.id,c.type", ["order_id" => $order_id]);
if(count($houseArr) > 0 && $houseArr[0]["type"] != 5){ //没找到楼盘和共享楼盘不改状态 if (count($houseArr) > 0 && $houseArr[0]["type"] != 5) { //没找到楼盘和共享楼盘不改状态
$room_id = $houseArr[0]["id"]; $room_id = $houseArr[0]["id"];
$roomModel = new OfficeGRoom(); $roomModel = new OfficeGRoom();
$roomModel->updateHouseNumByRevocationBargain($room_id); $roomModel->updateHouseNumByRevocationBargain($room_id);
...@@ -1519,7 +1519,7 @@ class OfficeOrderLogService ...@@ -1519,7 +1519,7 @@ class OfficeOrderLogService
$where_house["a.type"] = ['in', '2,3']; $where_house["a.type"] = ['in', '2,3'];
$where_house["a.is_del"] = 0; $where_house["a.is_del"] = 0;
$where_house["b.status"] = 0; $where_house["b.status"] = 0;
$agent_house = $houseAgents->getAgentsByHouseId($fields , $where_house); $agent_house = $houseAgents->getAgentsByHouseId($fields, $where_house);
$list = []; $list = [];
$key = 0; $key = 0;
......
...@@ -50,9 +50,10 @@ class MetroStations extends BaseModel ...@@ -50,9 +50,10 @@ class MetroStations extends BaseModel
public function getMetroStations($field,$params) public function getMetroStations($field,$params)
{ {
$result = $this $result = $this->db_
->field($field) ->field($field)
->where($params) ->where($params)
->order("sort_value asc")
->select(); ->select();
return $result; return $result;
} }
......
...@@ -129,7 +129,7 @@ class Regions extends Model ...@@ -129,7 +129,7 @@ class Regions extends Model
public function getRegionsByCity($city) { public function getRegionsByCity($city) {
$data = []; $data = [];
$param["type"] = 2; $param["type"] = 2;
$param["fullName"] = array( "like", "%" . trim($city) . "%" ); $param["fullName"] = array( "like", trim($city) . "%" );
$city_data = $this $city_data = $this
->field('code,fullName') ->field('code,fullName')
->where($param) ->where($param)
......
...@@ -366,7 +366,7 @@ Route::group('index', [ ...@@ -366,7 +366,7 @@ Route::group('index', [
'dayAchievementsReport' => ['index/PerformanceReport/dayAchievementsReportList', ['method' => 'POST|GET']],//日报liu 'dayAchievementsReport' => ['index/PerformanceReport/dayAchievementsReportList', ['method' => 'POST|GET']],//日报liu
'weekAchievementsReport' => ['index/PerformanceReport/weekAchievementsReportList', ['method' => 'POST|GET']],//周报liu 'weekAchievementsReport' => ['index/PerformanceReport/weekAchievementsReportList', ['method' => 'POST|GET']],//周报liu
'officeBuildingList' => ['index/OfficeBuilding/officeBuildingList', ['method' => 'POST|GET']],//办公楼liu 'officeBuildingList' => ['index/OfficeBuilding/officeBuildingList', ['method' => 'POST|GET']],//办公楼liu
// 'officeEdit' => ['index/OfficeBuilding/officeEdit', ['method' => 'POST|GET']],//办公楼新增编辑liu // 'officeEdit' => ['index/OfficeBuilding/officeEdit', ['method' => 'POST|GET']],//办公楼新增编辑liu
'buildingDictionary' => ['index/OfficeBuilding/buildingDictionary', ['method' => 'POST|GET']],//楼盘字典liu 'buildingDictionary' => ['index/OfficeBuilding/buildingDictionary', ['method' => 'POST|GET']],//楼盘字典liu
...@@ -375,7 +375,7 @@ Route::group('index', [ ...@@ -375,7 +375,7 @@ Route::group('index', [
'officeFollowUp' => ['index/OfficeBuilding/officeFollowUp', ['method' => 'POST|GET']],//办公楼列表跟进liu 'officeFollowUp' => ['index/OfficeBuilding/officeFollowUp', ['method' => 'POST|GET']],//办公楼列表跟进liu
'getCollectionOffice' => ['index/OfficeBuilding/getCollectionOffice', ['method' => 'POST|GET']],//收款记录办公楼liu 'getCollectionOffice' => ['index/OfficeBuilding/getCollectionOffice', ['method' => 'POST|GET']],//收款记录办公楼liu
'getCollectionShop' => ['index/OfficeBuilding/getCollectionShop', ['method' => 'POST|GET']],//收款记录商铺liu 'getCollectionShop' => ['index/OfficeBuilding/getCollectionShop', ['method' => 'POST|GET']],//收款记录商铺liu
// 'marchinListOffice' => ['index/OfficeBuilding/marchinListOffice', ['method' => 'POST|GET']],//进场记录办公楼liu // 'marchinListOffice' => ['index/OfficeBuilding/marchinListOffice', ['method' => 'POST|GET']],//进场记录办公楼liu
'reportListOffice' => ['index/OfficeBuilding/reportListOffice', ['method' => 'POST|GET']],//约带看记录办公楼liu 'reportListOffice' => ['index/OfficeBuilding/reportListOffice', ['method' => 'POST|GET']],//约带看记录办公楼liu
'adjustmentOffice' => ['index/OfficeBuilding/adjustmentOffice', ['method' => 'POST|GET']],//调整出账办公楼liu 'adjustmentOffice' => ['index/OfficeBuilding/adjustmentOffice', ['method' => 'POST|GET']],//调整出账办公楼liu
'adjustmentShop' => ['index/OfficeBuilding/adjustmentShop', ['method' => 'POST|GET']],//调整出账商铺liu 'adjustmentShop' => ['index/OfficeBuilding/adjustmentShop', ['method' => 'POST|GET']],//调整出账商铺liu
...@@ -1009,12 +1009,13 @@ Route::group('office', [ ...@@ -1009,12 +1009,13 @@ Route::group('office', [
'bargainMain' => ['api_broker/OfficeBargain/bargainList', ['method' => 'POST|GET']], 'bargainMain' => ['api_broker/OfficeBargain/bargainList', ['method' => 'POST|GET']],
'bargainMainV2' => ['api_broker/OfficeBargain/bargainListV2', ['method' => 'POST|GET']], 'bargainMainV2' => ['api_broker/OfficeBargain/bargainListV2', ['method' => 'POST|GET']],
'userFollowUpList' => [ 'api_broker/OfficeHomePageLog/userFollowUpList', [ 'method' => 'POST|GET' ] ], 'userFollowUpList' => ['api_broker/OfficeHomePageLog/userFollowUpList', ['method' => 'POST|GET']],
'houseFollowUpList' => [ 'api_broker/OfficeHomePageLog/houseFollowUpList', [ 'method' => 'POST|GET' ] ], 'houseFollowUpList' => ['api_broker/OfficeHomePageLog/houseFollowUpList', ['method' => 'POST|GET']],
'collectionListByBargainId' => [ 'api_broker/OfficePerformance/collectionListByBargainId', [ 'method' => 'POST|GET' ] ], 'collectionListByBargainId' => ['api_broker/OfficePerformance/collectionListByBargainId', ['method' => 'POST|GET']],
'getOfficeRoomByReport' => [ 'api_broker/OfficeRoom/getOfficeRoomByReport', [ 'method' => 'get|post' ] ], 'getOfficeRoomByReport' => ['api_broker/OfficeRoom/getOfficeRoomByReport', ['method' => 'get|post']],
'followUpLog' => [ 'api_broker/OfficeUser/followUpLog', [ 'method' => 'get|post' ] ], 'followUpLog' => ['api_broker/OfficeUser/followUpLog', ['method' => 'get|post']],
'getHouseAddress' => ['api_broker/OfficeRoom/checkRepetition', ['method' => 'get']], //搜索楼号/栋/座+楼层+房号 'getHouseAddress' => ['api_broker/OfficeRoom/checkRepetition', ['method' => 'get']], //搜索楼号/栋/座+楼层+房号
'filtrateConditionRoom' => ['api_broker/OfficeRoom/filtrateConditionRoom', ['method' => 'get']],
]); ]);
......
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