Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
5
51business
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
方斌
51business
Commits
b4cf11b2
Commit
b4cf11b2
authored
Apr 26, 2019
by
李尚科
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
https://t-git.51gjj.com/fangbin/51business
parents
529d6852
92d0cc20
Pipeline
#6515
passed with stage
in 4 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
18 deletions
+21
-18
new_house.js
app/controller/house/new_house.js
+1
-6
new_house.js
app/service/house/new_house.js
+20
-12
No files found.
app/controller/house/new_house.js
View file @
b4cf11b2
...
...
@@ -24,12 +24,7 @@ class NewHouseController extends Controller {
};
ctx
.
validate
(
rule
,
inputParams
);
let
ret
=
{};
// if (inputParams.hasOwnProperty('type') && inputParams.type !== '') {
// ret = await ctx.service.house.newHouse.getNewHouseListByType(inputParams);
// } else {
// ret = await ctx.service.house.newHouse.getNewHouseList(inputParams);
// }
ret
=
await
ctx
.
service
.
house
.
newHouse
.
getNewHouseListV2
(
inputParams
);
ret
=
await
ctx
.
service
.
house
.
newHouse
.
getNewHouseList
(
inputParams
);
ctx
.
success
(
ret
);
}
...
...
app/service/house/new_house.js
View file @
b4cf11b2
...
...
@@ -115,7 +115,7 @@ class NewHouseService extends Service {
for
(
let
i
in
developerinfo
)
{
developer
.
push
(
developerinfo
[
i
].
developer
.
name
);
}
//将json格式字符串处理
let
nearBy
=
''
;
if
(
data
.
residential
.
nearBy
.
length
>
0
)
{
let
temp
=
eval
(
data
.
residential
.
nearBy
);
...
...
@@ -127,6 +127,19 @@ class NewHouseService extends Service {
nearBy
+=
subTemp
+
';'
;
}
}
//房型面积处理
let
newHouseTypeList
=
data
.
newHouseType
;
let
typeArea
=
{
min
:
0
,
max
:
0
};
if
(
newHouseTypeList
.
length
>
0
)
{
for
(
let
i
in
newHouseTypeList
)
{
typeArea
.
min
=
typeArea
.
min
===
0
?
newHouseTypeList
[
i
].
area
:
(
newHouseTypeList
[
i
].
area
<
typeArea
.
min
?
newHouseTypeList
[
i
].
area
:
typeArea
.
min
);
typeArea
.
max
=
typeArea
.
max
===
0
?
newHouseTypeList
[
i
].
area
:
(
newHouseTypeList
[
i
].
area
>
typeArea
.
max
?
newHouseTypeList
[
i
].
area
:
typeArea
.
max
);
}
}
let
area
=
typeArea
.
min
===
typeArea
.
max
?
typeArea
.
min
:
typeArea
.
min
+
'-'
+
typeArea
.
max
;
ret
.
basic
=
{
id
:
data
.
id
,
name
:
data
.
name
,
//标题
...
...
@@ -141,7 +154,7 @@ class NewHouseService extends Service {
ret
.
info
=
{
open_date
:
data
.
openDate
,
//开盘时间
due_date
:
data
.
dueDate
,
//交房时间
house_area
:
data
.
houseA
rea
,
//建筑面积
house_area
:
a
rea
,
//建筑面积
decoration
:
decorationType
[
data
.
decorationType
]
||
''
,
//装修情况,1 毛坯,2简装,3精装
green_ratio
:
data
.
greenRatio
,
//绿化
area_ratio
:
data
.
areaRatio
,
//容积
...
...
@@ -270,7 +283,7 @@ class NewHouseService extends Service {
}
async
getNewHouseList
V2
(
condition
)
{
async
getNewHouseList
(
condition
)
{
const
{
ctx
,
service
}
=
this
;
let
types
=
[
'all'
,
'sale'
,
'open'
,
'favourable'
,
'home'
];
let
type
=
(
condition
.
hasOwnProperty
(
'type'
)
&&
types
.
includes
(
condition
.
type
))
?
condition
.
type
:
''
;
...
...
@@ -369,16 +382,11 @@ class NewHouseService extends Service {
if
(
condition
.
area
&&
condition
.
area
.
hasOwnProperty
(
'min'
)
&&
condition
.
area
.
hasOwnProperty
(
'max'
))
{
//面积
filter
.
queryConditions
.
push
(
{
key
:
'
houseA
rea'
,
value
:
condition
.
area
.
min
,
operator
:
'
greaterEqual
'
,
key
:
'
a
rea'
,
value
:
condition
.
area
.
min
+
','
+
condition
.
area
.
max
,
operator
:
'
between
'
,
},
{
key
:
'houseArea'
,
value
:
condition
.
area
.
max
,
operator
:
'lessEqual'
,
})
;
);
}
if
(
condition
.
house_type
)
{
//户型
filter
.
queryConditions
.
push
({
...
...
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