Commit be9de83e authored by 李尚科's avatar 李尚科
parents 632edc24 817abf13
Pipeline #6534 passed with stage
in 9 seconds
...@@ -140,6 +140,27 @@ class NewHouseService extends Service { ...@@ -140,6 +140,27 @@ class NewHouseService extends Service {
} }
} }
let area = typeArea.min === typeArea.max ? typeArea.min : typeArea.min + '-' + typeArea.max; let area = typeArea.min === typeArea.max ? typeArea.min : typeArea.min + '-' + typeArea.max;
//经纬度
const city = await ctx.blockModel.City.one({ where: { code: data.residential.city } });
const county = await ctx.blockModel.HouseDistrict.one({ where: { id: data.residential.county } });
const region = await ctx.blockModel.HouseBizcircle.one({ where: { id: data.residential.region } });
const city_name = city.name ? city.name : '';
const county_name = county.name ? county.name : '';
const region_name = region.name ? region.name : '';
let address = city_name + county_name + region_name + data.address;
let gps_result = await ctx.helper.getGPS(address, city_name);
if (!gps_result.lat || !gps_result.lng) {
address = city_name + county_name + region_name;
gps_result = await ctx.helper.getGPS(address, city_name);
}
let longitude = 0;
let latitude = 0;
if (gps_result) {
longitude = gps_result.lng;
latitude = gps_result.lat;
}
ret.basic = { ret.basic = {
id: data.id, id: data.id,
name: data.name,//标题 name: data.name,//标题
...@@ -159,6 +180,8 @@ class NewHouseService extends Service { ...@@ -159,6 +180,8 @@ class NewHouseService extends Service {
green_ratio: data.greenRatio,//绿化 green_ratio: data.greenRatio,//绿化
area_ratio: data.areaRatio,//容积 area_ratio: data.areaRatio,//容积
address: data.address,//地址 address: data.address,//地址
longitude: longitude,//经度
latitude: latitude,//纬度
} }
ret.detail = { ret.detail = {
basic: { basic: {
...@@ -329,7 +352,7 @@ class NewHouseService extends Service { ...@@ -329,7 +352,7 @@ class NewHouseService extends Service {
}); });
} else if (type === 'open') { } else if (type === 'open') {
//只展示最近三个月内开盘的楼盘,往前追溯三个月,列表单次加载30条楼盘数据,滑到底部再次加载30条 //只展示最近三个月内开盘的楼盘,往前追溯三个月,列表单次加载30条楼盘数据,滑到底部再次加载30条
let endDate = moment().subtract(30, 'days').format('YYYY-MM-DD HH:mm:ss'); let endDate = moment().subtract(90, 'days').format('YYYY-MM-DD HH:mm:ss');
filter.queryConditions.push({ filter.queryConditions.push({
key: "openDate", key: "openDate",
value: endDate, value: endDate,
......
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