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
9fc6d809
Commit
9fc6d809
authored
Aug 09, 2019
by
Hsinli
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add
parent
7bed8089
Pipeline
#12059
passed with stage
in 20 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
0 deletions
+25
-0
tool.js
app/controller/house/v2/tool.js
+24
-0
house.js
app/router/house.js
+1
-0
No files found.
app/controller/house/v2/tool.js
View file @
9fc6d809
'use strict'
;
const
Controller
=
require
(
'egg'
).
Controller
;
const
_
=
require
(
'lodash'
);
const
R
=
require
(
'ramda'
);
const
moment
=
require
(
'moment'
);
class
ToolController
extends
Controller
{
...
...
@@ -386,6 +387,29 @@ class ToolController extends Controller {
ctx
.
success
(
ret
);
}
//购房资格的问题可支持的城市
async
getHouseQuestionCity
()
{
const
{
ctx
}
=
this
;
//所有支持的城市编码
let
filter
=
{
attributes
:
[
'id'
],
where
:
{
id
:
330100
}
}
let
cityCode
=
await
ctx
.
blockModel
.
HouseQuestion
.
findAll
(
filter
);
let
ret
=
[];
if
(
cityCode
!==
undefined
&&
cityCode
.
length
>
0
)
{
let
cityCodes
=
_
.
uniq
(
_
.
map
(
cityCode
,
'id'
));
let
cityFilter
=
{
attributes
:
[
'name'
,
'code'
],
where
:
{
code
:
{
$in
:
cityCodes
}
}
}
let
cityName
=
await
ctx
.
blockModel
.
City
.
findAll
(
cityFilter
);
ret
=
cityName
!==
undefined
?
cityName
:
[];
}
return
ret
;
}
//房价指数可支持的城市
async
getHousePriceFeatureCity
()
{
...
...
app/router/house.js
View file @
9fc6d809
...
...
@@ -54,6 +54,7 @@ module.exports = app => {
router
.
post
(
'/v2.1/tool/plan'
,
'house.v2.tool.generateBuyHousePlan_2_1'
);
//生成购房计划
router
.
get
(
'/v2/tool/plan_area_list'
,
'house.v2.tool.planAreaList'
);
//购房计划页面 区域列表接口
router
.
get
(
'/v2/tool/:type/:city_code'
,
'house.v2.tool.getHousePriceFeature'
);
//房价走势图 房价涨跌图 购房资格图、贷款额度问答、供需趋势图
router
.
get
(
'/v2/tool/qusetion/city'
,
'house.v2.tool.getHouseQuestionCity'
);
//购房资格问题支持的城市
router
.
post
(
'/v2/tool/calculate_price'
,
'house.tool.calculateHousePrice'
);
//房产估价
router
.
get
(
'/v2/tool/qfang_area_list'
,
'house.tool.getQFangAreaList'
);
//房产估价模糊匹配到的小区列表
router
.
get
(
'/v2/tool/map_houses'
,
'house.tool.getMapHouses'
);
//房产估价模糊匹配到的小区列表
...
...
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