Commit 25ef7e0d authored by 李尚科's avatar 李尚科
parents b6bfce96 f7930abc
Pipeline #10366 passed with stage
in 4 seconds
...@@ -307,7 +307,7 @@ class Export20190425 extends Controller { ...@@ -307,7 +307,7 @@ class Export20190425 extends Controller {
user_id: list[i].userId, user_id: list[i].userId,
// app_type_id:list[i].xxx, // app_type_id:list[i].xxx,
app_user_id: list[i].appUserId, app_user_id: list[i].appUserId,
house_style: list[i].xxx, house_style: list[i].houseStyle,
connect_id: list[i].connectId, connect_id: list[i].connectId,
state: list[i].state, state: list[i].state,
remark: list[i].remark, remark: list[i].remark,
......
...@@ -182,7 +182,7 @@ class CollectionService extends Service { ...@@ -182,7 +182,7 @@ class CollectionService extends Service {
}, },
order: [['id', 'desc']] order: [['id', 'desc']]
} }
let list = await ctx.realestateModel.Collection.all(filter); let list = await ctx.realestateModel.Collection.findAll(filter);
let count = 0; let count = 0;
if (list.length > 0) { if (list.length > 0) {
let newHouseId = []; let newHouseId = [];
......
...@@ -132,41 +132,32 @@ class FootPrintService extends Service { ...@@ -132,41 +132,32 @@ class FootPrintService extends Service {
}, },
order: [['created_at', 'desc']] order: [['created_at', 'desc']]
} }
const list = await ctx.realestateModel.FootPrint.all(filter); const list = await ctx.realestateModel.FootPrint.findAll(filter);
let count = 0; let count = 0;
if (list.length > 0) { if (list.length > 0) {
let newHouseId = []; let taskList = [];
let rentalHouseId = [];
for (let i in list) { for (let i in list) {
let taskFilter = {
attributes: ['id'],
where: {
status: 'online',
valid: 1,
id: list[i].connect_id
}
}
if (Number(list[i].house_style) === 1) { if (Number(list[i].house_style) === 1) {
newHouseId.push(list[i].connect_id); taskList[i] = ctx.realestateModel.NewHouse.one(taskFilter);
} }
if (Number(list[i].house_style) === 2) { if (Number(list[i].house_style) === 2) {
rentalHouseId.push(list[i].connect_id); taskList[i] = ctx.realestateModel.RentalHouse.one(taskFilter);
} }
} }
let newHousefilter = { const retList = await Promise.all(taskList).then(result => {
where: {
status: 'online',
valid: 1,
id: { $in: newHouseId },
},
}
let newHouseCountTask = ctx.realestateModel.NewHouse.count(newHousefilter);
let rentalHousefilter = {
where: {
status: 'online',
valid: 1,
id: { $in: rentalHouseId },
},
}
let rentalHouseCountTask = ctx.realestateModel.RentalHouse.count(rentalHousefilter);
const retList = await Promise.all([newHouseCountTask, rentalHouseCountTask]).then(result => {
return result; return result;
}).catch(error => { }).catch(error => {
ctx.failed(error); ctx.failed(error);
}); });
count = Number(retList[0]) + Number(retList[1]); count = Number(retList.length);
} }
let ret = { let ret = {
count: count count: count
......
...@@ -136,7 +136,7 @@ class OrderService extends Service { ...@@ -136,7 +136,7 @@ class OrderService extends Service {
}, },
order: [['id', 'desc']] order: [['id', 'desc']]
} }
let list = await ctx.realestateModel.Order.all(filter); let list = await ctx.realestateModel.Order.findAll(filter);
let count = 0; let count = 0;
if (list.length > 0) { if (list.length > 0) {
let newHouseId = []; let newHouseId = [];
......
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