diff --git a/src/app.controller.ts b/src/app.controller.ts index 50c039a..3a57fc2 100644 --- a/src/app.controller.ts +++ b/src/app.controller.ts @@ -380,7 +380,7 @@ export class AppController { async getVisiotr(@Query() { identity_card_no, area_code }: QueryVisitorByNumberDto, @Req() req: any) { let date = new Date().toDateString(); let node_other_visitor; - const where: any = { identity_card_no, end_time: IsNull() }; + const where: any = { identity_card_no, end_time: IsNull() }; if (area_code) { where.to_area_code = area_code; } @@ -896,7 +896,12 @@ export class AppController { .take(query_data.take) .orderBy(order_key, order_value) .getManyAndCount(); - return { list, count } + const new_list = await bluebird.map(list, async (item) => { + const result = await this.areaRepository.findOne({ where: { id: item.area_id } }) + item.area = result; + return item; + }) + return { list: new_list, count } } @Put("/visitor/number")