|
|
|
|
@ -209,8 +209,19 @@ export class AppController {
|
|
|
|
|
@Get("/visitor")
|
|
|
|
|
@ApiBearerAuth()
|
|
|
|
|
async getVisiotr(@Query() { identity_card_no }: QueryVisitorByNumberDto, @Req() req: any) {
|
|
|
|
|
const node_visitor = await this.nodeOtherVisitorRepository.findOne({ where: { identity_card_no } })
|
|
|
|
|
return node_visitor
|
|
|
|
|
const node_other_visitor: any = await this.nodeOtherVisitorRepository.findOne({
|
|
|
|
|
where: { identity_card_no },
|
|
|
|
|
order: {
|
|
|
|
|
created_date: "DESC"
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
if (node_other_visitor) {
|
|
|
|
|
const node_visitor = await this.nodeVisitorRepository.findOne({
|
|
|
|
|
where: { id: node_other_visitor.node_visitor_id }
|
|
|
|
|
})
|
|
|
|
|
node_other_visitor.info = node_visitor;
|
|
|
|
|
}
|
|
|
|
|
return node_other_visitor
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Get("/visitors")
|
|
|
|
|
@ -380,6 +391,7 @@ export class AppController {
|
|
|
|
|
data: result,
|
|
|
|
|
};
|
|
|
|
|
} catch (e) {
|
|
|
|
|
console.log("e", e)
|
|
|
|
|
return {
|
|
|
|
|
code: -2,
|
|
|
|
|
msg: e.message,
|
|
|
|
|
|