Skip to content

Commit

Permalink
update query get order item
Browse files Browse the repository at this point in the history
  • Loading branch information
mehranus committed Nov 15, 2024
1 parent 1b83d91 commit cbc5b59
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"files.autoSave": "afterDelay",
"editor.fontFamily": "Ubuntu",
"editor.fontSize": 14
}
22 changes: 20 additions & 2 deletions src/modules/order/order.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit cbc5b59

Please sign in to comment.