lrf 8 months ago
parent
commit
038e0d95e9
1 changed files with 1 additions and 0 deletions
  1. 1 0
      src/service/system/dept.service.ts

+ 1 - 0
src/service/system/dept.service.ts

@@ -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;