mirror of
https://github.com/rgrgogu/new_starr.git
synced 2026-09-27 00:12:54 +08:00
@@ -27,7 +27,8 @@ const computedAttributes = [
|
||||
literal: `(
|
||||
SELECT CAST(COUNT(*) AS INTEGER)
|
||||
FROM "units"
|
||||
WHERE "units"."course_id" = "Course"."course_id"
|
||||
INNER JOIN "course_units" ON "course_units"."unit_id" = "units"."unit_id"
|
||||
WHERE "course_units"."course_id" = "Course"."course_id"
|
||||
AND "units"."deletedAt" IS NULL
|
||||
)`,
|
||||
filterable: false,
|
||||
@@ -38,10 +39,12 @@ const computedAttributes = [
|
||||
type: "number",
|
||||
order: 6,
|
||||
literal: `(
|
||||
SELECT CAST(COUNT(*) AS INTEGER)
|
||||
SELECT CAST(COUNT(DISTINCT "lessons"."lesson_id") AS INTEGER)
|
||||
FROM "lessons"
|
||||
INNER JOIN "units" ON "lessons"."unit_id" = "units"."unit_id"
|
||||
WHERE "units"."course_id" = "Course"."course_id"
|
||||
INNER JOIN "unit_lessons" ON "unit_lessons"."lesson_id" = "lessons"."lesson_id"
|
||||
INNER JOIN "units" ON "unit_lessons"."unit_id" = "units"."unit_id" AND "units"."deletedAt" IS NULL
|
||||
INNER JOIN "course_units" ON "course_units"."unit_id" = "units"."unit_id"
|
||||
WHERE "course_units"."course_id" = "Course"."course_id"
|
||||
AND "lessons"."deletedAt" IS NULL
|
||||
)`,
|
||||
filterable: false,
|
||||
|
||||
Reference in New Issue
Block a user