Commit b8e18a15 authored by Hsinli's avatar Hsinli

add a between

parent 13432d20
Pipeline #6504 passed with stage
in 9 seconds
......@@ -115,7 +115,7 @@ class NewHouseService extends Service {
for (let i in developerinfo) {
developer.push(developerinfo[i].developer.name);
}
//将json格式字符串处理
let nearBy = '';
if (data.residential.nearBy.length > 0) {
let temp = eval(data.residential.nearBy);
......@@ -127,6 +127,20 @@ class NewHouseService extends Service {
nearBy += subTemp + ';';
}
}
//房型面积处理
let newHouseTypeList = data.newHouseType;
let typeArea = {
min: 0,
max: 0
};
if (newHouseTypeList.length > 0) {
for (let i in newHouseTypeList) {
typeArea.min = typeArea.min === 0 ? newHouseTypeList[i].area : (newHouseTypeList[i].area < typeArea.min ? newHouseTypeList[i].area : typeArea.min);
typeArea.max = typeArea.max === 0 ? newHouseTypeList[i].area : (newHouseTypeList[i].area > typeArea.max ? newHouseTypeList[i].area : typeArea.max);
}
}
let area = typeArea.min === typeArea.max ? typeArea.min : typeArea.min + '-' + typeArea.max;
ctx.logger.info(area);
ret.basic = {
id: data.id,
name: data.name,//标题
......
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