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
2ac5bd44
Commit
2ac5bd44
authored
Jun 04, 2019
by
zhuwei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
房源列表
parent
66275ad7
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
64 additions
and
25 deletions
+64
-25
OfficeRoomService.php
application/index/service/OfficeRoomService.php
+17
-0
OfficeService.php
application/index/service/OfficeService.php
+47
-25
No files found.
application/index/service/OfficeRoomService.php
View file @
2ac5bd44
...
...
@@ -32,6 +32,7 @@ class OfficeRoomService
private
$agent
;
private
$agent_room
;
private
$landlord_phone
;
private
$internet_path
;
public
function
__construct
()
{
...
...
@@ -42,6 +43,12 @@ class OfficeRoomService
$this
->
agent
=
new
AAgents
();
$this
->
agent_room
=
new
OfficeGRoomToAgent
();
$this
->
landlord_phone
=
new
OfficeGLandlordPhone
();
if
(
CURRENT_URL
==
'https://api.tonglianjituan.com/'
)
{
$this
->
internet_path
=
IMAGES_URL
.
'/resource/lib/Attachments/images/'
;
}
else
{
$this
->
internet_path
=
'http://pre2.tonglianjituan.com/resource/lib/Attachments/images/'
;
}
}
/**
...
...
@@ -676,6 +683,11 @@ class OfficeRoomService
$where
[
'house_id'
]
=
$id
;
$where
[
'img_type'
]
=
0
;
$house_img_data
=
$this
->
m_office_img
->
getListAll
(
'id,img_name'
,
$where
);
if
(
$house_img_data
){
foreach
(
$house_img_data
as
$k
=>
$v
)
{
$house_img_data
[
$k
][
'image_path'
]
=
$this
->
internet_path
.
$v
[
'img_name'
];
}
}
return
$house_img_data
;
}
...
...
@@ -689,6 +701,11 @@ class OfficeRoomService
$where
[
'house_id'
]
=
$id
;
$where
[
'img_type'
]
=
2
;
$house_img_data
=
$this
->
m_office_img
->
getListAll
(
'id,img_name'
,
$where
);
if
(
$house_img_data
){
foreach
(
$house_img_data
as
$k
=>
$v
)
{
$house_img_data
[
$k
][
'image_path'
]
=
$this
->
internet_path
.
$v
[
'img_name'
];
}
}
return
$house_img_data
;
}
...
...
application/index/service/OfficeService.php
View file @
2ac5bd44
...
...
@@ -351,14 +351,52 @@ class OfficeService
//标签
$result
[
'building_sign'
]
=
$this
->
getBuildingSign
(
$id
);
//房源列表
$result
[
'room_list'
]
=
$this
->
getRoomList
(
$id
);
return
[
'status'
=>
200
,
'msg'
=>
'success'
,
'data'
=>
$result
];
}
/**
* 标签
* @param $id
* @return string
*/
//房源列表
private
function
getRoomList
(
$id
){
$m_office_room
=
new
OfficeGRoom
();
$field
=
"a.id,a.area,a.price_total,a.price,a.station_start,a.station_end,a.decoration"
;
$params
[
"a.id"
]
=
$id
;
$res
=
$m_office_room
->
getRoomInfo
(
$field
,
$params
);
if
(
$res
){
foreach
(
$res
as
$k
=>
$v
)
{
$res
[
$k
][
'price_total'
]
=
$v
[
'price_total'
]
*
0.01
;
$res
[
$k
][
'price'
]
=
$v
[
'price'
]
*
0.01
;
$res
[
$k
][
'cover_image'
]
=
$this
->
getCoverImage
(
$v
[
'id'
]);
}
}
return
$res
;
}
//房源封面图
private
function
getCoverImage
(
$id
){
if
(
CURRENT_URL
==
'https://api.tonglianjituan.com/'
)
{
$internet_path
=
IMAGES_URL
.
'/resource/lib/Attachments/images/'
;
}
else
{
$internet_path
=
'http://pre2.tonglianjituan.com/resource/lib/Attachments/images/'
;
}
$where
[
'img_status'
]
=
0
;
$where
[
'house_id'
]
=
$id
;
$where
[
'img_type'
]
=
1
;
$house_img_data
=
$this
->
m_office_img
->
getListAll
(
'id,img_name'
,
$where
);
if
(
$house_img_data
){
foreach
(
$house_img_data
as
$k
=>
$v
)
{
$house_img_data
[
$k
][
'image_path'
]
=
$internet_path
.
$v
[
'img_name'
];
}
}
return
$house_img_data
;
// return $house_img_data[0]['img_name'];
}
//标签
private
function
getBuildingSign
(
$id
){
$m_office_room
=
new
OfficeGRoom
();
$field
=
'shop_sign'
;
...
...
@@ -377,12 +415,7 @@ class OfficeService
return
$shop_sign
;
}
/**
* 最大最小面积
* @param $id
* @param $type
* @return int
*/
//最大最小面积
private
function
getAreaMaxOrMin
(
$id
,
$type
){
$m_office_room
=
new
OfficeGRoom
();
$field
=
'MAX(area) as num'
;
...
...
@@ -396,11 +429,7 @@ class OfficeService
return
$reference_average_price
;
}
/**
* 轮播图
* @param $id
* @return string
*/
//轮播图
private
function
getCarouselImage
(
$id
){
$where
[
'img_status'
]
=
0
;
$where
[
'house_id'
]
=
$id
;
...
...
@@ -409,20 +438,13 @@ class OfficeService
return
$house_img_data
;
}
/**
* 交通信息
* @param $id
* @return string
*/
//交通信息
private
function
getTrafficInfo
(
$id
){
$res
=
'8号线地铁站出站300米'
;
return
$res
;
}
/**
* 房源数
* @return int|string
*/
//房源数
private
function
getRoomNum
(
$id
){
$m_office_room
=
new
OfficeGRoom
();
$params
[
'building_id'
]
=
$id
;
...
...
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