Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
T
tl_estate
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
hujun
tl_estate
Commits
0e8d7d8c
Commit
0e8d7d8c
authored
Jun 03, 2019
by
zhuwei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
办公楼详情
parent
152e6d7d
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
87 additions
and
2 deletions
+87
-2
OfficeRoom.php
application/api_broker/controller/OfficeRoom.php
+1
-1
officeBuilding.php
application/api_broker/controller/officeBuilding.php
+20
-0
OfficeService.php
application/index/service/OfficeService.php
+64
-0
route.php
application/route.php
+2
-1
No files found.
application/api_broker/controller/OfficeRoom.php
View file @
0e8d7d8c
...
@@ -92,7 +92,7 @@ class OfficeRoom extends Basic
...
@@ -92,7 +92,7 @@ class OfficeRoom extends Basic
{
{
$params
=
$this
->
params
;
$params
=
$this
->
params
;
$checkResult
=
$this
->
validate
(
$params
,
"OfficeRoomValidate.
modifyAgentPassword
"
);
$checkResult
=
$this
->
validate
(
$params
,
"OfficeRoomValidate.
getOfficeRoomInfo
"
);
if
(
true
!==
$checkResult
)
{
if
(
true
!==
$checkResult
)
{
return
$this
->
response
(
"101"
,
$checkResult
);
return
$this
->
response
(
"101"
,
$checkResult
);
}
}
...
...
application/api_broker/controller/officeBuilding.php
View file @
0e8d7d8c
...
@@ -41,4 +41,23 @@ class OfficeBuilding extends Basic
...
@@ -41,4 +41,23 @@ class OfficeBuilding extends Basic
}
}
return
$this
->
response
(
$code
,
$msg
);
return
$this
->
response
(
$code
,
$msg
);
}
}
/**
* 办公楼详情
* @return \think\Response
*/
public
function
getOfficeBuildingInfo
(){
$params
=
$this
->
params
;
$checkResult
=
$this
->
validate
(
$params
,
"OfficeRoomValidate.getOfficeRoomInfo"
);
if
(
true
!==
$checkResult
)
{
return
$this
->
response
(
"101"
,
$checkResult
);
}
$s_office
=
new
OfficeService
();;
$result
=
$s_office
->
getOfficeBuildingInfo
(
$params
);
return
$this
->
response
(
$result
[
'status'
],
$result
[
'msg'
],
$result
[
'data'
]);
}
}
}
\ No newline at end of file
application/index/service/OfficeService.php
View file @
0e8d7d8c
...
@@ -15,6 +15,7 @@ use app\model\GBusinessDistrict;
...
@@ -15,6 +15,7 @@ use app\model\GBusinessDistrict;
use
app\model\OfficeGBuilding
;
use
app\model\OfficeGBuilding
;
use
app\model\OfficeGImg
;
use
app\model\OfficeGImg
;
use
app\model\OfficeGBuildingStations
;
use
app\model\OfficeGBuildingStations
;
use
app\model\OfficeGRoom
;
class
OfficeService
class
OfficeService
{
{
...
@@ -320,4 +321,66 @@ class OfficeService
...
@@ -320,4 +321,66 @@ class OfficeService
return
$data
;
return
$data
;
}
}
/**
* 办公楼详情
* @return array
*/
public
function
getOfficeBuildingInfo
(
$params
){
if
(
!
isset
(
$params
[
'id'
])
or
!
$params
[
'id'
])
return
[
'status'
=>
101
,
'msg'
=>
'办公楼ID不能为空'
];
$field
=
'a.id,a.title,a.type,a.floor_total,a.address,a.traffic_info,a.room_num,a.intro'
;
$result
=
$data
=
$this
->
m_office
->
getFindData
(
$field
,
[
'id'
=>
$params
[
"id"
]]);;
if
(
!
$result
)
{
return
[
'status'
=>
101
,
'msg'
=>
'此办公楼不存在'
];
}
#轮播图
$result
[
'carousel_image'
]
=
$this
->
getCarouselImage
(
$result
[
'id'
]);
#房源数
$result
[
'room_num'
]
=
$this
->
getRoomNum
(
$result
[
'id'
]);
#交通信息
$result
[
'traffic_info'
]
=
$this
->
getTrafficInfo
(
$result
[
'id'
]);
return
[
'status'
=>
200
,
'msg'
=>
'success'
,
'data'
=>
$result
];
}
/**
* 轮播图
* @param $id
* @return string
*/
public
function
getCarouselImage
(
$id
){
$where
[
'img_status'
]
=
0
;
$where
[
'house_id'
]
=
$id
;
$where
[
'img_type'
]
=
2
;
$house_img_data
=
$this
->
m_office_img
->
getListAll
(
'id,img_name'
,
$where
);
return
$house_img_data
;
}
/**
* 交通信息
* @param $id
* @return string
*/
public
function
getTrafficInfo
(
$id
){
$res
=
'8号线地铁站出站300米'
;
return
$res
;
}
/**
* 房源数
* @return int|string
*/
public
function
getRoomNum
(
$id
){
$m_office_room
=
new
OfficeGRoom
();
$params
[
'building_id'
]
=
$id
;
$params
[
'is_rent'
]
=
0
;
$params
[
'status'
]
=
1
;
$res
=
$m_office_room
->
getRoomNum
(
$params
);
return
$res
;
}
}
}
\ No newline at end of file
application/route.php
View file @
0e8d7d8c
...
@@ -972,7 +972,8 @@ Route::group('office', [
...
@@ -972,7 +972,8 @@ Route::group('office', [
'getBuildingDetail'
=>
[
'api_broker/OfficeRoom/getBuildingDetail'
,
[
'method'
=>
'GET'
]],
//楼盘详情
'getBuildingDetail'
=>
[
'api_broker/OfficeRoom/getBuildingDetail'
,
[
'method'
=>
'GET'
]],
//楼盘详情
'getOfficeBuildingAddress'
=>
[
'api_broker/shop/getOfficeBuildingAddress'
,
[
'method'
=>
'GET'
]],
//确认无重盘楼盘字典
'getOfficeBuildingAddress'
=>
[
'api_broker/shop/getOfficeBuildingAddress'
,
[
'method'
=>
'GET'
]],
//确认无重盘楼盘字典
'getOfficeRoomInfo'
=>
[
'api_broker/OfficeRoom/getOfficeRoomInfo'
,
[
'method'
=>
'GET|POST'
]
],
//获取房源详情
'getOfficeBuildingInfo'
=>
[
'api_broker/OfficeBuilding/getOfficeBuildingInfo'
,
[
'method'
=>
'GET|POST'
]
],
//办公楼详情
'getOfficeRoomInfo'
=>
[
'api_broker/OfficeRoom/getOfficeRoomInfo'
,
[
'method'
=>
'GET|POST'
]
],
//获取房源详情
]);
]);
Route
::
group
(
'office_index'
,
[
Route
::
group
(
'office_index'
,
[
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment