明树Git Lab

Commit 13c2a6c0 authored by zengfanpei's avatar zengfanpei

update

parent 09970380
......@@ -267,9 +267,11 @@ async function getAreaDistribution(req, res, next) {
}
//往下取一层
let len = zonePre.parentIds && zonePre.parentIds.length || 0;
let zones = await DB.Zone.find({ "parentIds": { $size: len + 1, $elemMatch: { $eq: zonePre._id } } }).lean().exec(); //查找所有子区域
// let zones = await DB.Zone.find({ "parentIds": { $size: len + 1, $elemMatch: { $eq: zonePre._id } } }).lean().exec(); //查找所有子区域
let zones = await DB.Zone.find({ "parentIds": { $elemMatch: { $eq: zonePre._id } } }).lean().exec(); //查找所有子区域
let zoneIds = zones.map(o => { return o._id });
zoneIds.push(zonePre._id);
console.log(zones)
let lands = await DB.Land.aggregate([
{ $match: { zone: { $in: zoneIds } } },
{
......
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