This commit is contained in:
louiscklaw
2025-05-08 17:19:43 +08:00
parent 7105bc85e3
commit 5640d4d4f6
46 changed files with 520 additions and 268 deletions

View File

@@ -2,6 +2,9 @@ import { pb } from '@/lib/pb';
import { COL_USER_METAS } from '@/constants';
export async function getAllTeachersCount(): Promise<number> {
const result = await pb.collection(COL_USER_METAS).getList(1, 1, { filter: `role = "teacher"` });
const result = await pb.collection(COL_USER_METAS).getList(1, 1, {
filter: `role = "teacher"`,
//
});
return result.totalItems;
}

View File

@@ -1,8 +1,8 @@
import { COL_TEACHERS } from '@/constants';
import { COL_USER_METAS } from '@/constants';
import { pb } from '@/lib/pb';
export default async function GetBlockedCount(): Promise<number> {
const { totalItems: count } = await pb.collection(COL_TEACHERS).getList(1, 1, {
const { totalItems: count } = await pb.collection(COL_USER_METAS).getList(1, 1, {
filter: 'status = "blocked"',
});
return count;

View File

@@ -1,9 +1,9 @@
import { COL_CUSTOMERS } from '@/constants';
import { COL_USER_METAS } from '@/constants';
import { pb } from '@/lib/pb';
export default async function GetPendingCount(): Promise<number> {
const { totalItems: count } = await pb.collection(COL_CUSTOMERS).getList(1, 1, {
filter: 'status = "pending"',
const { totalItems: count } = await pb.collection(COL_USER_METAS).getList(1, 1, {
filter: 'status = "pending" && role = "teacher"',
});
return count;
}