Commit 51f3ec60 authored by 李尚科's avatar 李尚科

add house price search

parent b68c4ac3
......@@ -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;
......@@ -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');//点击房源信息跳到地图页 此房源周边信息。
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment