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
85aa410a
Commit
85aa410a
authored
Jun 04, 2019
by
hujun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
最小价格
parent
d7e4ae2a
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
8 deletions
+22
-8
OfficeRoomService.php
application/index/service/OfficeRoomService.php
+13
-0
OfficeService.php
application/index/service/OfficeService.php
+9
-8
No files found.
application/index/service/OfficeRoomService.php
View file @
85aa410a
...
...
@@ -674,6 +674,19 @@ class OfficeRoomService
return
$reference_average_price
;
}
/**
* 字段最低值
*
* @param $id
* @param $field
* @return float|int
*/
public
function
MinField
(
$id
,
$field
=
''
){
$where
[
'building_id'
]
=
$id
;
$field_string
=
"min(
{
$field
}
) as min"
;
return
$this
->
m_office_room
->
getFieldOneValue
(
$field_string
,
$where
);
}
/**
* 楼盘图
* @param $id
...
...
application/index/service/OfficeService.php
View file @
85aa410a
...
...
@@ -9,7 +9,6 @@
namespace
app\index\service
;
use
app\index\controller\BusinessDistrict
;
use
app\index\validate\OfficeBuildingValidate
;
use
app\model\GBusinessDistrict
;
use
app\model\OfficeGBuilding
;
...
...
@@ -23,6 +22,7 @@ class OfficeService
private
$m_office
;
private
$m_office_img
;
private
$m_building_stations
;
private
$service_room
;
public
function
__construct
()
{
...
...
@@ -30,6 +30,7 @@ class OfficeService
$this
->
m_office
=
new
OfficeGBuilding
();
$this
->
m_office_img
=
new
OfficeGImg
();
$this
->
m_building_stations
=
new
OfficeGBuildingStations
();
$this
->
service_room
=
new
OfficeRoomService
();
}
/**
...
...
@@ -344,8 +345,7 @@ class OfficeService
$result
[
'traffic_info'
]
=
$this
->
getTrafficInfo
(
$result
[
'id'
]);
//参考均价
$s_office_room
=
new
OfficeRoomService
();
$result
[
'reference_average_price'
]
=
$s_office_room
->
referenceAveragePrice
(
$id
);
$result
[
'reference_average_price'
]
=
$this
->
service_room
->
referenceAveragePrice
(
$id
);
//最大最小面积
$result
[
'area_max'
]
=
$this
->
getAreaMaxOrMin
(
$id
,
'max'
);
...
...
@@ -534,7 +534,7 @@ class OfficeService
$where
[
'b.shop_sign'
]
=
[
'like'
,
'%'
.
$params
[
'shop_sign'
]
.
'%'
];
//商铺标签
}
$field
=
'a.id,a.disc,
b.area,b.price,title,address,c.name as business_name,b.shop_sign,b.price_total
'
;
$field
=
'a.id,a.disc,
title,address,c.name as business_name
'
;
try
{
$data
=
$this
->
m_office
->
getBuildingRoom
(
$page_no
,
$page_size
,
''
,
$field
,
$where
);
}
catch
(
\Exception
$e
)
{
...
...
@@ -546,10 +546,11 @@ class OfficeService
$result_data
=
[];
foreach
(
$data
as
$k
=>
$v
)
{
$tmp
[
'id'
]
=
$v
[
'id'
];
$tmp
[
'title'
]
=
$v
[
'disc'
]
.
' '
.
$v
[
'business_name'
]
.
' '
.
$v
[
'title'
]
.
' '
.
$v
[
'area'
]
.
'㎡'
;
$tmp
[
'price'
]
=
$v
[
'price'
]
/
100
;
$tmp
[
'price_total'
]
=
$v
[
'price_total'
]
/
100
;
$tmp
[
'shop_sign'
]
=
empty
(
$v
[
'shop_sign'
])
?
''
:
$v
[
'shop_sign'
];
$tmp
[
'price'
]
=
$this
->
service_room
->
MinField
(
$v
[
'id'
],
'price'
);
$tmp
[
'price_total'
]
=
$this
->
service_room
->
MinField
(
$v
[
'id'
],
'price_total'
);
$tmp
[
'shop_sign'
]
=
$this
->
getBuildingSign
(
$v
[
'id'
]);
$area
=
$this
->
service_room
->
MinField
(
$v
[
'id'
],
'area'
);
$tmp
[
'title'
]
=
$v
[
'disc'
]
.
' '
.
$v
[
'business_name'
]
.
' '
.
$v
[
'title'
]
.
' '
.
$area
.
'㎡'
;
$result_data
[]
=
$tmp
;
}
$result
[
'status'
]
=
'successful'
;
...
...
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