|
@@ -3,7 +3,7 @@ import { InjectEntityModel } from '@midwayjs/typeorm';
|
|
|
import { Repository, Equal } from 'typeorm';
|
|
|
import { Incubator } from '../../entity/users/incubator.entity';
|
|
|
import { BaseServiceV2 } from '../../frame/BaseServiceV2';
|
|
|
-import { get, uniq } from 'lodash';
|
|
|
+import { get, uniq, compact } from 'lodash';
|
|
|
import { Cirelation } from '../../entity/users/cirelation.entity';
|
|
|
import { CompanyService } from './company.service';
|
|
|
import { CompanyYear } from '../../entity/users/companyYear.entity';
|
|
@@ -113,11 +113,13 @@ export class IncubatorService extends BaseServiceV2 {
|
|
|
const companyids = res.map(i => i.company);
|
|
|
const list = [];
|
|
|
const { data } = await this.companyService.query({ id: companyids }, {});
|
|
|
- const nameList = uniq(data.map(i => i.industry));
|
|
|
+ const nameList = compact(uniq(data.map(i => i.industry)));
|
|
|
for (const val of nameList) {
|
|
|
- const { total } = await this.companyService.query({ id: companyids, industry: val }, { skip: 0, limit: 1 });
|
|
|
- const info = { value: total, name: val };
|
|
|
- list.push(info);
|
|
|
+ if (val) {
|
|
|
+ const { total } = await this.companyService.query({ id: companyids, industry: val }, { skip: 0, limit: 1 });
|
|
|
+ const info = { value: total, name: val };
|
|
|
+ list.push(info);
|
|
|
+ }
|
|
|
}
|
|
|
return { nameList, list };
|
|
|
}
|