From 92383d6c5708e8d66d45f4ce465a030b6adb2580 Mon Sep 17 00:00:00 2001 From: rustdreamer Date: Mon, 11 Sep 2023 14:19:07 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=97=B6=E9=97=B4?= 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 d11d1c5..5c42f1d 100644 --- a/src/app.controller.ts +++ b/src/app.controller.ts @@ -229,18 +229,23 @@ export class AppController { @Get("/visitor") @ApiBearerAuth() async getVisiotr(@Query() { identity_card_no }: QueryVisitorByNumberDto, @Req() req: any) { - let date = new Date().getDate(); + let date = new Date().toDateString(); const node_other_visitor: any = await this.nodeOtherVisitorRepository.findOne({ where: { identity_card_no }, order: { created_date: "DESC" } }); + // console.log('node_other_visitor', node_other_visitor) if (node_other_visitor) { const node_visitor = await this.nodeVisitorRepository.findOne({ where: { id: node_other_visitor.node_visitor_id } }) - if (new Date(node_visitor.start_date) <= new Date(date) && new Date(node_visitor.end_date) >= new Date(date)) { + // console.log('node_visitor', node_visitor) + // console.log('new Date(node_visitor.start_date)', new Date(node_visitor.start_date)) + // console.log('new Date(node_visitor.end_date)', new Date(node_visitor.end_date)) + // console.log('new Date(date)', new Date(date)) + if (node_visitor && new Date(node_visitor.start_date) <= new Date(date) && new Date(node_visitor.end_date) >= new Date(date)) { node_other_visitor.info = node_visitor; } else { return null;