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
51f3ec60
Commit
51f3ec60
authored
Jun 18, 2019
by
李尚科
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add house price search
parent
b68c4ac3
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
3 deletions
+19
-3
tool.js
app/controller/house/v2/tool.js
+18
-3
house.js
app/router/house.js
+1
-0
No files found.
app/controller/house/v2/tool.js
View file @
51f3ec60
...
...
@@ -229,6 +229,7 @@ class ToolController extends Controller {
ctx
.
success
({
results
:
ret
});
}
//购房计划城市区域列表
async
planAreaList
()
{
const
{
ctx
}
=
this
;
...
...
@@ -323,7 +324,7 @@ class ToolController extends Controller {
}
const
month
=
moment
(
new
Date
()).
format
(
'MM'
);
const
ret
=
{
city_
name
:
city
.
name
,
name
:
city
.
name
,
description
:
`
${
month
}
月参考均价`
,
price
:
result
.
price
,
unit
:
'元/平'
,
...
...
@@ -333,10 +334,24 @@ class ToolController extends Controller {
}
//房产估价
//房价指数,搜索结果
async
getHousePriceFeatureSearch
()
{
const
{
ctx
}
=
this
;
const
input_parmas
=
ctx
.
request
.
body
;
const
keyword
=
input_parmas
.
keyword
;
const
city_code
=
input_parmas
.
city_code
;
let
results
=
[];
if
(
keyword
&&
city_code
)
{
const
month
=
moment
(
new
Date
()).
format
(
'MM'
);
const
house_price_map_results
=
await
ctx
.
blockModel
.
HousePriceMap
.
all
({
where
:
{
pid
:
city_code
,
name
:
{
$like
:
`%
${
keyword
}
%`
}
}
});
results
=
house_price_map_results
.
map
(
item
=>
{
return
{
name
:
item
.
name
,
description
:
`
${
month
}
月参考价`
,
price
:
item
.
price
,
unit
:
'元/平'
}
});
}
//并无实际用途 只用于调试测试用
ctx
.
success
({
results
});
}
//房产估价
}
module
.
exports
=
ToolController
;
app/router/house.js
View file @
51f3ec60
...
...
@@ -57,6 +57,7 @@ module.exports = app => {
router
.
get
(
'/v2/tool/map_houses'
,
'house.tool.getMapHouses'
);
//房产估价模糊匹配到的小区列表
router
.
get
(
'/v2/tool/house_price_feature_city'
,
'house.v2.tool.getHousePriceFeatureCity'
);
//房价指数 城市月参考价支持的城市
router
.
get
(
'/v2/tool/house_price_city'
,
'house.v2.tool.getHousePriceCity'
);
//房价指数 城市月参考价
router
.
post
(
'/v2/tool/house_price_search'
,
'house.v2.tool.getHousePriceFeatureSearch'
);
//房价指数 搜索结果
router
.
get
(
'/v2/tool/house_point'
,
'house.v2.tool.getHousePoint'
);
//点击房源信息跳到地图页 需要的经纬度信息。
router
.
post
(
'/v2/tool/nearby_house_points'
,
'house.v2.tool.getHouseNearbyPoint'
);
//点击房源信息跳到地图页 此房源周边信息。
...
...
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