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
7d0a4075
Commit
7d0a4075
authored
Jun 03, 2019
by
zhuwei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
是否被收藏
parent
5ffe168a
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
52 additions
and
5 deletions
+52
-5
OfficeRoom.php
application/api_broker/controller/OfficeRoom.php
+1
-1
OfficeRoomService.php
application/index/service/OfficeRoomService.php
+26
-1
OfficeService.php
application/index/service/OfficeService.php
+25
-3
No files found.
application/api_broker/controller/OfficeRoom.php
View file @
7d0a4075
...
@@ -99,7 +99,7 @@ class OfficeRoom extends Basic
...
@@ -99,7 +99,7 @@ class OfficeRoom extends Basic
$broker_service
=
new
OfficeRoomService
();
$broker_service
=
new
OfficeRoomService
();
$id
=
$params
[
'id'
];
$id
=
$params
[
'id'
];
$result
=
$broker_service
->
getOfficeRoomInfo
(
$id
);
$result
=
$broker_service
->
getOfficeRoomInfo
(
$id
,
$this
->
agentId
);
return
$this
->
response
(
$result
[
'status'
],
$result
[
'msg'
],
$result
[
'data'
]);
return
$this
->
response
(
$result
[
'status'
],
$result
[
'msg'
],
$result
[
'data'
]);
}
}
...
...
application/index/service/OfficeRoomService.php
View file @
7d0a4075
...
@@ -14,6 +14,7 @@ use app\api_broker\service\RedisCacheService;
...
@@ -14,6 +14,7 @@ use app\api_broker\service\RedisCacheService;
use
app\index\validate\OfficeBuildingRoomValidate
;
use
app\index\validate\OfficeBuildingRoomValidate
;
use
app\model\AAgents
;
use
app\model\AAgents
;
use
app\model\GBusinessDistrict
;
use
app\model\GBusinessDistrict
;
use
app\model\OfficeACollectHouse
;
use
app\model\OfficeGBuilding
;
use
app\model\OfficeGBuilding
;
use
app\model\OfficeGImg
;
use
app\model\OfficeGImg
;
use
app\model\OfficeGLandlordPhone
;
use
app\model\OfficeGLandlordPhone
;
...
@@ -592,7 +593,7 @@ class OfficeRoomService
...
@@ -592,7 +593,7 @@ class OfficeRoomService
* 获取房源详情
* 获取房源详情
* @return array
* @return array
*/
*/
public
function
getOfficeRoomInfo
(
$id
){
public
function
getOfficeRoomInfo
(
$id
,
$agent_id
){
$field
=
'a.id,a.building_id,b.title,b.province,b.city,b.disc,b.floor_total,a.price_total,a.price,a.station_start,b.type,a.station_end,a.area,a.floor,a.floor_tag,
$field
=
'a.id,a.building_id,b.title,b.province,b.city,b.disc,b.floor_total,a.price_total,a.price,a.station_start,b.type,a.station_end,a.area,a.floor,a.floor_tag,
a.is_register,a.age_limit_start,a.age_limit_end,a.rent_free,a.management_fee,a.slotting_fee,a.carport,a.enter_date,
a.is_register,a.age_limit_start,a.age_limit_end,a.rent_free,a.management_fee,a.slotting_fee,a.carport,a.enter_date,
...
@@ -625,10 +626,34 @@ class OfficeRoomService
...
@@ -625,10 +626,34 @@ class OfficeRoomService
$result
[
'reference_average_price'
]
=
$this
->
referenceAveragePrice
(
$result
[
'building_id'
]);
$result
[
'reference_average_price'
]
=
$this
->
referenceAveragePrice
(
$result
[
'building_id'
]);
//楼盘图
//楼盘图
$result
[
'building_image'
]
=
$this
->
getBuildingImage
(
$result
[
'building_id'
]);
$result
[
'building_image'
]
=
$this
->
getBuildingImage
(
$result
[
'building_id'
]);
//是否被收藏
$result
[
'is_collect'
]
=
$this
->
isCollect
(
$result
[
'id'
],
$agent_id
);
return
[
'status'
=>
200
,
'msg'
=>
'success'
,
'data'
=>
$result
];
return
[
'status'
=>
200
,
'msg'
=>
'success'
,
'data'
=>
$result
];
}
}
/**
* 是否被收藏
* @param $house_id
* @param $agent_id
* @return int
*/
private
function
isCollect
(
$house_id
,
$agent_id
){
$m_collect_room
=
new
OfficeACollectHouse
();
//是否被收藏
$is_collect
=
2
;
if
(
$agent_id
)
{
//先判断是否已经存在数据
$field
=
'id,status'
;
$get_params
[
'agents_id'
]
=
$agent_id
;
$get_params
[
'house_id'
]
=
$house_id
;
$res
=
$m_collect_room
->
getCollectHouse
(
$field
,
$get_params
);
if
(
$res
&&
(
$res
[
0
][
'status'
]
==
1
))
{
//如果存在
$is_collect
=
1
;
}
}
return
$is_collect
;
}
/**
/**
* 参考均价
* 参考均价
*/
*/
...
...
application/index/service/OfficeService.php
View file @
7d0a4075
...
@@ -345,16 +345,38 @@ class OfficeService
...
@@ -345,16 +345,38 @@ class OfficeService
$s_office_room
=
new
OfficeRoomService
();
$s_office_room
=
new
OfficeRoomService
();
$result
[
'reference_average_price'
]
=
$s_office_room
->
referenceAveragePrice
(
$id
);
$result
[
'reference_average_price'
]
=
$s_office_room
->
referenceAveragePrice
(
$id
);
//最大最小面积
$result
[
'area_max'
]
=
$this
->
getAreaMaxOrMin
(
$id
,
'max'
);
$result
[
'area_min'
]
=
$this
->
getAreaMaxOrMin
(
$id
,
'min'
);
return
[
'status'
=>
200
,
'msg'
=>
'success'
,
'data'
=>
$result
];
return
[
'status'
=>
200
,
'msg'
=>
'success'
,
'data'
=>
$result
];
}
}
/**
* 最大最小面积
* @param $id
* @param $type
* @return int
*/
private
function
getAreaMaxOrMin
(
$id
,
$type
){
$m_office_room
=
new
OfficeGRoom
();
$field
=
'MAX(area) as num'
;
if
(
$type
==
'min'
){
$field
=
'MIN(area) as num'
;
}
$where
[
'building_id'
]
=
$id
;
$where
[
'status'
]
=
1
;
$res
=
$m_office_room
->
getRoom
(
$field
,
$where
);
$reference_average_price
=
isset
(
$res
[
0
][
"num"
])
?
$res
[
0
][
"num"
]
*
0.01
:
0
;
return
$reference_average_price
;
}
/**
/**
* 轮播图
* 轮播图
* @param $id
* @param $id
* @return string
* @return string
*/
*/
p
ublic
function
getCarouselImage
(
$id
){
p
rivate
function
getCarouselImage
(
$id
){
$where
[
'img_status'
]
=
0
;
$where
[
'img_status'
]
=
0
;
$where
[
'house_id'
]
=
$id
;
$where
[
'house_id'
]
=
$id
;
$where
[
'img_type'
]
=
2
;
$where
[
'img_type'
]
=
2
;
...
@@ -367,7 +389,7 @@ class OfficeService
...
@@ -367,7 +389,7 @@ class OfficeService
* @param $id
* @param $id
* @return string
* @return string
*/
*/
p
ublic
function
getTrafficInfo
(
$id
){
p
rivate
function
getTrafficInfo
(
$id
){
$res
=
'8号线地铁站出站300米'
;
$res
=
'8号线地铁站出站300米'
;
return
$res
;
return
$res
;
}
}
...
@@ -376,7 +398,7 @@ class OfficeService
...
@@ -376,7 +398,7 @@ class OfficeService
* 房源数
* 房源数
* @return int|string
* @return int|string
*/
*/
p
ublic
function
getRoomNum
(
$id
){
p
rivate
function
getRoomNum
(
$id
){
$m_office_room
=
new
OfficeGRoom
();
$m_office_room
=
new
OfficeGRoom
();
$params
[
'building_id'
]
=
$id
;
$params
[
'building_id'
]
=
$id
;
$params
[
'is_rent'
]
=
0
;
$params
[
'is_rent'
]
=
0
;
...
...
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