From 65615ff67a4aff9425a41628063ca2104a1a3092 Mon Sep 17 00:00:00 2001 From: Veirt Date: Thu, 5 Dec 2024 11:35:34 +0800 Subject: [PATCH] feat(order): get needed data to render in my session --- src/module/order/order.repository.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/module/order/order.repository.ts b/src/module/order/order.repository.ts index 3a0508b..454ac72 100644 --- a/src/module/order/order.repository.ts +++ b/src/module/order/order.repository.ts @@ -1,5 +1,6 @@ import { db as dbType } from "@/db/config"; import { + categories, learners, orders, tutories as tutoriesTable, @@ -73,16 +74,20 @@ export class OrderRepository { id: orders.id, status: orders.status, sessionTime: orders.sessionTime, + estimatedEndTime: orders.estimatedEndTime, + categoryName: categories.name, tutorId: tutoriesTable.tutorId, tutorName: tutors.name, learnerId: orders.learnerId, learnerName: learners.name, typeLesson: tutoriesTable.typeLesson, + price: orders.price, }) .from(orders) .innerJoin(tutoriesTable, eq(orders.tutoriesId, tutoriesTable.id)) .innerJoin(tutors, eq(tutoriesTable.tutorId, tutors.id)) .innerJoin(learners, eq(orders.learnerId, learners.id)) + .innerJoin(categories, eq(tutoriesTable.categoryId, categories.id)) .where(and(...conditions)); return query;