@@ -28,6 +28,7 @@ export class DeptService extends BaseServiceV2 {
const total = await builder.getCount();
const ids = result.map(i => i.parent_id);
// const parents = await this.model.find({ where: { id: In(ids) }, select: ['id', 'name'] });
+ if (ids.length <= 0) return { data: [], total: 0 };
const { data: parents } = await this.query({ id: ids }, { selects: ['id', 'name'] }, { id: this.Opera.In });
result.map(i => {
if (!i.parent_id) return i;