From c4a83d908ef01289bb9b62be20c83ba3f79b8cdd Mon Sep 17 00:00:00 2001 From: rustdreamer Date: Tue, 9 Apr 2024 15:07:48 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0area=E8=BF=94=E5=9B=9E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app.controller.ts | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) 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")