Commit c9f2923a authored by hujun's avatar hujun

楼盘详情

parent 8e1b7ab6
...@@ -131,4 +131,27 @@ class OfficeRoom extends Basic ...@@ -131,4 +131,27 @@ class OfficeRoom extends Basic
return $this->response($code, $msg, $data); return $this->response($code, $msg, $data);
} }
/**
* 楼盘详情
*
* @return \think\Response
*/
public function getBuildingDetail()
{
$msg = '';
$data = [];
$code = 200;
$building_service = new OfficeService();
$result = $building_service->getOfficeDetail($this->params['id']);
if ($result['status'] == 'fail') {
$code = 101;
$msg = $result['msg'];
} else {
$data = $result['data'];
}
return $this->response($code, $msg, $data);
}
} }
\ No newline at end of file
...@@ -91,4 +91,28 @@ class OfficeRoom extends Basic ...@@ -91,4 +91,28 @@ class OfficeRoom extends Basic
return $this->response($code, $msg, $data); return $this->response($code, $msg, $data);
} }
/**
* 楼盘详情
*
* @return \think\Response
*/
public function getBuildingDetail()
{
$msg = '';
$data = [];
$code = 200;
$building_service = new OfficeService();
$result = $building_service->getOfficeDetail($this->params['id']);
if ($result['status'] == 'fail') {
$code = 101;
$msg = $result['msg'];
} else {
$data = $result['data'];
}
return $this->response($code, $msg, $data);
}
} }
\ No newline at end of file
...@@ -299,7 +299,7 @@ class OfficeRoomService ...@@ -299,7 +299,7 @@ class OfficeRoomService
$office = new OfficeGBuilding(); $office = new OfficeGBuilding();
$m_landlord = new OfficeGLandlordPhone(); $m_landlord = new OfficeGLandlordPhone();
$data['total'] = $office->getFieldOneValue('title', ['id'=>$data['building_id']]); $data['title'] = $office->getFieldOneValue('title', ['id'=>$data['building_id']]);
$data['landlord_phone_array'] = $m_landlord->getAllList('id,name,phone', ['house_id'=>$data['id']]); $data['landlord_phone_array'] = $m_landlord->getAllList('id,name,phone', ['house_id'=>$data['id']]);
} }
$result['data'] = $data; $result['data'] = $data;
......
...@@ -109,7 +109,7 @@ class OfficeService ...@@ -109,7 +109,7 @@ class OfficeService
* @param int $app * @param int $app
* @return mixed * @return mixed
*/ */
public function getOfficeDetail(int $id, $app = 0) public function getOfficeDetail($id, $app = 0)
{ {
$result['status'] = 'fail'; $result['status'] = 'fail';
$result['msg'] = ''; $result['msg'] = '';
......
...@@ -15,6 +15,7 @@ class OfficeBuildingRoomValidate extends Validate ...@@ -15,6 +15,7 @@ class OfficeBuildingRoomValidate extends Validate
{ {
protected $rule = [ protected $rule = [
'id' => 'require|between: 1,99999999999', 'id' => 'require|between: 1,99999999999',
'building_id' => 'require|between: 1,99999999999',
'floor' => 'require|between: 1,99999', 'floor' => 'require|between: 1,99999',
'room_number' => 'require|length:1,50', 'room_number' => 'require|length:1,50',
'is_rent' => 'require|in:0,1', 'is_rent' => 'require|in:0,1',
......
...@@ -966,6 +966,7 @@ Route::group('office', [ ...@@ -966,6 +966,7 @@ Route::group('office', [
'houseEdit' => ['api_broker/OfficeRoom/edit', ['method' => 'POST|GET']],//楼盘字典新增和编辑 'houseEdit' => ['api_broker/OfficeRoom/edit', ['method' => 'POST|GET']],//楼盘字典新增和编辑
'delHouseFile' => ['api_broker/OfficeRoom/delHouseFile', ['method' => 'POST']],//删除楼盘图片 'delHouseFile' => ['api_broker/OfficeRoom/delHouseFile', ['method' => 'POST']],//删除楼盘图片
'getBuildingSearch' => ['api_broker/OfficeRoom/getBuildingSearch', ['method' => 'GET']],//搜索楼盘 'getBuildingSearch' => ['api_broker/OfficeRoom/getBuildingSearch', ['method' => 'GET']],//搜索楼盘
'getBuildingDetail' => ['api_broker/OfficeRoom/getBuildingDetail', ['method' => 'GET']],//楼盘详情
]); ]);
Route::group('office_index', [ Route::group('office_index', [
...@@ -975,5 +976,7 @@ Route::group('office_index', [ ...@@ -975,5 +976,7 @@ Route::group('office_index', [
'houseDictionaryAdd' => ['index/OfficeManage/add', ['method' => 'GET|POST']],//楼盘字典新增 'houseDictionaryAdd' => ['index/OfficeManage/add', ['method' => 'GET|POST']],//楼盘字典新增
'houseDictionaryEdit' => ['index/OfficeManage/edit', ['method' => 'GET|POST']],//楼盘字典编辑 'houseDictionaryEdit' => ['index/OfficeManage/edit', ['method' => 'GET|POST']],//楼盘字典编辑
'getBuildingSearch' => ['index/OfficeRoom/getBuildingSearch', ['method' => 'GET']],//搜索楼盘 'getBuildingSearch' => ['index/OfficeRoom/getBuildingSearch', ['method' => 'GET']],//搜索楼盘
'getBuildingDetail' => ['index/OfficeRoom/getBuildingDetail', ['method' => 'GET']],//楼盘详情
]); ]);
//Route::miss('api/index/miss');//处理错误的url //Route::miss('api/index/miss');//处理错误的url
\ No newline at end of file
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