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
2115e0c2
Commit
2115e0c2
authored
Jun 11, 2019
by
李尚科
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
options fix
parent
ab52da41
Pipeline
#8672
passed with stage
in 4 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
41 deletions
+9
-41
developer.js
app/model/realestate/developer.js
+1
-1
house.js
app/router/house.js
+1
-1
option.js
app/service/house/v2/option.js
+7
-39
No files found.
app/model/realestate/developer.js
View file @
2115e0c2
...
@@ -11,7 +11,7 @@ module.exports = app => {
...
@@ -11,7 +11,7 @@ module.exports = app => {
primaryKey
:
true
,
primaryKey
:
true
,
autoIncrement
:
true
,
autoIncrement
:
true
,
},
},
address
:
{
short_name
:
{
type
:
STRING
,
type
:
STRING
,
allowNull
:
true
allowNull
:
true
},
},
...
...
app/router/house.js
View file @
2115e0c2
...
@@ -52,7 +52,7 @@ module.exports = app => {
...
@@ -52,7 +52,7 @@ module.exports = app => {
router
.
get
(
'/v2/rental_house/list'
,
'house.v2.rentalHouse.getRentalHouses'
);
//租房列表
router
.
get
(
'/v2/rental_house/list'
,
'house.v2.rentalHouse.getRentalHouses'
);
//租房列表
router
.
post
(
'/v2/rental_house/list'
,
'house.v2.rentalHouse.getRentalHouses'
);
//租房列表
router
.
post
(
'/v2/rental_house/list'
,
'house.v2.rentalHouse.getRentalHouses'
);
//租房列表
router
.
get
(
'/v2/rental_house/info/:rental_house_id'
,
'house.v2.rentalHouse.getRentalHouse'
);
//住房详情
router
.
get
(
'/v2/rental_house/info/:rental_house_id'
,
'house.v2.rentalHouse.getRentalHouse'
);
//住房详情
router
.
get
(
'/v2/options/:city_code'
,
'house.v2.options.getOptions'
);
//筛选项信息
router
.
get
(
'
add'
,
'
/v2/options/:city_code'
,
'house.v2.options.getOptions'
);
//筛选项信息
//足迹
//足迹
router
.
get
(
'/v2/foot_print/list'
,
'house.v2.footPrint.getFootPrintList'
);
//用户浏览记录列表
router
.
get
(
'/v2/foot_print/list'
,
'house.v2.footPrint.getFootPrintList'
);
//用户浏览记录列表
...
...
app/service/house/v2/option.js
View file @
2115e0c2
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
'use strict'
;
'use strict'
;
const
Service
=
require
(
'egg'
).
Service
;
const
Service
=
require
(
'egg'
).
Service
;
const
R
=
require
(
'ramda'
);
const
PRICE_RANGE
=
[
const
PRICE_RANGE
=
[
{
name
:
'不限'
,
id
:
-
100
,
min
:
0
,
max
:
0
},
{
name
:
'不限'
,
id
:
-
100
,
min
:
0
,
max
:
0
},
{
name
:
'2000元以下'
,
id
:
-
101
,
min
:
0
,
max
:
2000
},
{
name
:
'2000元以下'
,
id
:
-
101
,
min
:
0
,
max
:
2000
},
...
@@ -79,7 +79,8 @@ class OptionService extends Service {
...
@@ -79,7 +79,8 @@ class OptionService extends Service {
{
name
:
'品牌'
,
id
:
-
1
,
path
:
[],
nameShow
:
''
,
_children
:
brands
},
{
name
:
'品牌'
,
id
:
-
1
,
path
:
[],
nameShow
:
''
,
_children
:
brands
},
{
name
:
'区域'
,
id
:
-
2
,
path
:
[],
nameShow
:
''
,
_children
:
areas
},
{
name
:
'区域'
,
id
:
-
2
,
path
:
[],
nameShow
:
''
,
_children
:
areas
},
{
name
:
'价格'
,
id
:
-
3
,
path
:
[],
nameShow
:
''
,
_children
:
prices
},
{
name
:
'价格'
,
id
:
-
3
,
path
:
[],
nameShow
:
''
,
_children
:
prices
},
{
name
:
'户型'
,
id
:
-
4
,
path
:
[],
nameShow
:
''
,
_children
:
house_types
}]
{
name
:
'户型'
,
id
:
-
4
,
path
:
[],
nameShow
:
''
,
_children
:
house_types
}
]
};
};
}
}
...
@@ -111,43 +112,10 @@ class OptionService extends Service {
...
@@ -111,43 +112,10 @@ class OptionService extends Service {
async
getDevelopers
(
city_code
)
{
async
getDevelopers
(
city_code
)
{
const
{
ctx
}
=
this
;
const
{
ctx
}
=
this
;
const
developers_results
=
await
ctx
.
service
.
houseCommon
.
developer
.
all
({});
const
rental_house_developers
=
await
ctx
.
realestateModel
.
RentalHouse
.
findAll
({
attributes
:
[
'developer_id'
],
group
:
'developer_id'
,
where
:
{
option_city_code
:
city_code
}
});
const
developers
=
developers_results
.
results
;
const
developers_ids
=
rental_house_developers
.
map
(
item
=>
{
return
item
.
dataValues
.
developer_id
});
const
ret
=
[];
const
developers
=
await
ctx
.
realestateModel
.
Developer
.
all
({
where
:
{
id
:
{
$in
:
developers_ids
}
}
});
city_code
=
city_code
?
parseInt
(
city_code
)
:
330100
;
const
ret
=
developers
.
map
(
item
=>
{
return
{
id
:
item
.
id
,
name
:
item
.
name
,
image
:
item
.
logo
,
value
:
item
.
id
}
});
const
setting_ret
=
await
ctx
.
blockModel
.
Setting
.
one
({
where
:
{
keyword
:
'config_fangc_developers'
}
});
const
setting_value
=
ctx
.
helper
.
JsonParse
(
setting_ret
.
value
);
for
(
let
i
in
developers
)
{
const
developer
=
developers
[
i
];
if
(
setting_value
&&
setting_value
[
city_code
])
{
const
setting_developers
=
setting_value
[
city_code
];
if
(
setting_developers
.
includes
(
developer
.
id
))
{
ret
.
push
({
id
:
developer
.
id
,
name
:
developer
.
name
,
image
:
developer
.
logo
,
value
:
developer
.
id
,
});
}
}
// if (city_code === 330100 && [2, 4, 5, 6, 7].includes(developer.id)) {
// ret.push({
// id: developer.id,
// name: developer.name,
// image: developer.logo,
// value: developer.id,
// });
// }
// if (city_code === 500000 && [1, 3].includes(developer.id)) {
// ret.push({
// id: developer.id,
// name: developer.name,
// image: developer.logo,
// value: developer.id,
// });
// }
}
return
ret
;
return
ret
;
}
}
...
...
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