Commit 04244228 authored by Hsinli's avatar Hsinli

addd

parent dba566b6
Pipeline #5958 passed with stage
in 2 seconds
......@@ -57,7 +57,7 @@ class NewHouseService extends Service {
}
}
//户型信息
let newHouseType = await this.formatNewHouseTypeList(newHouseInfo.newHouseType);
let newHouseType = await this.formatNewHouseTypeList(newHouseInfo);
//是否关注
let collectionFilter = { type: 1, id: id }
let collection = await service.house.collection.getCollection(collectionFilter);
......@@ -182,13 +182,15 @@ class NewHouseService extends Service {
* 对newHouseTypeList格式化
* @param {object} newHouseTypeList
*/
async formatNewHouseTypeList(newHouseTypeList) {
async formatNewHouseTypeList(newHouseInfo) {
const { ctx, service } = this;
let newHouseTypeList = newHouseInfo.newHouseType;
//数据格式化
let retList = [];
if (newHouseTypeList.length > 0) {
let taskList = [];
for (let i in newHouseTypeList) {
newHouseTypeList[i].houseType = newHouseInfo.houseType;
taskList[i] = this.formatNewHouseType(newHouseTypeList[i]);
}
......@@ -235,12 +237,14 @@ class NewHouseService extends Service {
async formatNewHouseType(data) {
const { ctx } = this;
const saleType = { 0: '未开售', 1: '售罄', 2: '预售', 3: '在售' };
const houseType = { 1: '住宅', 2: '公寓' };
let ret = {};
if (Object.keys(data).length > 0) {
ret = {
id: data.id,
newHouseId: data.newHouseId,
type: data.type,//类型,如三居、四居
house_type: houseType[data.houseType],
image: data.image,
apartment: data.apartment,//户型,如4室2厅3卫
sale_type: saleType[data.saleType],
......@@ -310,13 +314,13 @@ class NewHouseService extends Service {
if (condition.area) {//面积
filter.queryConditions.push(
{
key: 'area',
key: 'houseArea',
value: condition.area.min,
operator: 'greaterEqual',
},
{
key: 'area',
value: condition.area.min,
key: 'houseArea',
value: condition.area.max,
operator: 'lessEqual',
})
;
......
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