Skip to content

Commit

Permalink
feat(order): get needed data to render in my session
Browse files Browse the repository at this point in the history
  • Loading branch information
Veirt committed Dec 5, 2024
1 parent ee0f255 commit 65615ff
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/module/order/order.repository.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { db as dbType } from "@/db/config";
import {
categories,
learners,
orders,
tutories as tutoriesTable,
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 65615ff

Please sign in to comment.