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
7328b181
Commit
7328b181
authored
Jul 04, 2019
by
李尚科
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
house v2 fix
parent
5c225a7c
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
7 deletions
+18
-7
tool.js
app/controller/house/v2/tool.js
+17
-6
house.js
app/router/house.js
+1
-1
No files found.
app/controller/house/v2/tool.js
View file @
7328b181
...
@@ -282,24 +282,35 @@ class ToolController extends Controller {
...
@@ -282,24 +282,35 @@ class ToolController extends Controller {
const
input_parmas
=
ctx
.
params
;
const
input_parmas
=
ctx
.
params
;
const
rule
=
{
const
rule
=
{
type
:
{
type
:
'string'
,
required
:
true
},
type
:
{
type
:
'string'
,
required
:
true
},
area
_code
:
{
type
:
'string'
,
required
:
true
},
city
_code
:
{
type
:
'string'
,
required
:
true
},
}
}
ctx
.
validate
(
rule
,
input_parmas
);
ctx
.
validate
(
rule
,
input_parmas
);
const
type
=
input_parmas
.
type
;
const
type
=
input_parmas
.
type
;
const
area_code
=
input_parmas
.
area_code
;
const
city_code
=
input_parmas
.
city_code
;
const
area_code
=
ctx
.
query
.
area_code
;
console
.
info
(
area_code
);
let
ret
=
[];
let
ret
=
[];
if
(
type
===
'trend'
)
{
if
(
type
===
'trend'
)
{
ret
=
await
ctx
.
blockModel
.
HousePriceTrend
.
one
({
where
:
{
id
:
area_code
}
});
if
(
area_code
)
{
ret
=
await
ctx
.
blockModel
.
HousePriceTrend2
.
one
({
where
:
{
id
:
area_code
,
pid
:
city_code
}
});
}
else
{
ret
=
await
ctx
.
blockModel
.
HousePriceTrend
.
one
({
where
:
{
id
:
city_code
}
});
}
ret
=
ret
?
ret
.
trend_json
:
[];
ret
=
ret
?
ret
.
trend_json
:
[];
}
else
if
(
type
===
'increase'
)
{
}
else
if
(
type
===
'increase'
)
{
ret
=
await
ctx
.
blockModel
.
HousePriceIncrease
.
one
({
where
:
{
id
:
area
_code
}
});
ret
=
await
ctx
.
blockModel
.
HousePriceIncrease
.
one
({
where
:
{
id
:
city
_code
}
});
ret
=
ret
?
ret
.
increase_json
:
[];
ret
=
ret
?
ret
.
increase_json
:
[];
}
else
if
(
type
===
'question'
)
{
}
else
if
(
type
===
'question'
)
{
ret
=
await
ctx
.
blockModel
.
HouseQuestion
.
one
({
where
:
{
id
:
area
_code
}
});
ret
=
await
ctx
.
blockModel
.
HouseQuestion
.
one
({
where
:
{
id
:
city
_code
}
});
ret
=
ret
?
ret
.
question_json
:
[];
ret
=
ret
?
ret
.
question_json
:
[];
}
else
if
(
type
===
'supply'
)
{
}
else
if
(
type
===
'supply'
)
{
ret
=
await
ctx
.
blockModel
.
HouseSupplyDemand
.
one
({
where
:
{
id
:
area_code
}
});
if
(
area_code
)
{
ret
=
await
ctx
.
blockModel
.
HouseSupplyDemand2
.
one
({
where
:
{
id
:
area_code
,
pid
:
city_code
}
});
}
else
{
ret
=
await
ctx
.
blockModel
.
HouseSupplyDemand
.
one
({
where
:
{
id
:
city_code
}
});
}
ret
=
ret
?
ret
.
supply_demand_json
:
[];
ret
=
ret
?
ret
.
supply_demand_json
:
[];
}
}
...
...
app/router/house.js
View file @
7328b181
...
@@ -52,7 +52,7 @@ module.exports = app => {
...
@@ -52,7 +52,7 @@ module.exports = app => {
router
.
get
(
'/v2/tool/:house_style/:area_code/:level'
,
'house.v2.tool.getMapPoint'
);
//购房计划地图点位(存钱罐地图)(房价地图)
router
.
get
(
'/v2/tool/:house_style/:area_code/:level'
,
'house.v2.tool.getMapPoint'
);
//购房计划地图点位(存钱罐地图)(房价地图)
router
.
post
(
'/v2/tool/plan'
,
'house.v2.tool.generateBuyHousePlan'
);
//生成购房计划
router
.
post
(
'/v2/tool/plan'
,
'house.v2.tool.generateBuyHousePlan'
);
//生成购房计划
router
.
get
(
'/v2/tool/plan_area_list'
,
'house.v2.tool.planAreaList'
);
//购房计划页面 区域列表接口
router
.
get
(
'/v2/tool/plan_area_list'
,
'house.v2.tool.planAreaList'
);
//购房计划页面 区域列表接口
router
.
get
(
'/v2/tool/:type/:
area
_code'
,
'house.v2.tool.getHousePriceFeature'
);
//房价走势图 房价涨跌图 购房资格图、贷款额度问答、供需趋势图
router
.
get
(
'/v2/tool/:type/:
city
_code'
,
'house.v2.tool.getHousePriceFeature'
);
//房价走势图 房价涨跌图 购房资格图、贷款额度问答、供需趋势图
router
.
post
(
'/v2/tool/calculate_price'
,
'house.tool.calculateHousePrice'
);
//房产估价
router
.
post
(
'/v2/tool/calculate_price'
,
'house.tool.calculateHousePrice'
);
//房产估价
router
.
get
(
'/v2/tool/qfang_area_list'
,
'house.tool.getQFangAreaList'
);
//房产估价模糊匹配到的小区列表
router
.
get
(
'/v2/tool/qfang_area_list'
,
'house.tool.getQFangAreaList'
);
//房产估价模糊匹配到的小区列表
router
.
get
(
'/v2/tool/map_houses'
,
'house.tool.getMapHouses'
);
//房产估价模糊匹配到的小区列表
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