From cbc5b591da9333a268200bb2f5ef635fd55571a3 Mon Sep 17 00:00:00 2001 From: mehran feriduni Date: Fri, 15 Nov 2024 15:10:56 +0330 Subject: [PATCH] update query get order item --- .vscode/settings.json | 5 +++++ src/modules/order/order.service.ts | 22 ++++++++++++++++++++-- 2 files changed, 25 insertions(+), 2 deletions(-) create mode 100644 .vscode/settings.json diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..2d70660 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,5 @@ +{ + "files.autoSave": "afterDelay", + "editor.fontFamily": "Ubuntu", + "editor.fontSize": 14 +} \ No newline at end of file diff --git a/src/modules/order/order.service.ts b/src/modules/order/order.service.ts index 0b85ce5..5a5517f 100644 --- a/src/modules/order/order.service.ts +++ b/src/modules/order/order.service.ts @@ -74,8 +74,26 @@ export class OrderService { const {id:suppliarId}=this.req.suppliar const order=await this.orderRepository.find( { - relations:{items:{suppliar:true}}, - where:{items:{suppliarId}} + relations:{user:{addressList:true},items:{food:true}}, + where:{items:{suppliarId},status:OrderStatus.Paid}, + select:{ + items:{ + count:true, + status:true + }, + user:{ + first_name:true, + last_name:true, + phone:true, + addressList:{ + province:true, + city:true, + address:true, + postal_code:true, + } + } + } + } ) return order