From ee52d354c7f44052c585a27f4974a9f6512c1196 Mon Sep 17 00:00:00 2001 From: dujinkim Date: Tue, 23 Sep 2025 07:53:01 +0000 Subject: (대표님, 임수민) 도큐먼트 리스트 role 수정 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/pq/service.ts | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) (limited to 'lib/pq') diff --git a/lib/pq/service.ts b/lib/pq/service.ts index 172542a3..7aa80dfa 100644 --- a/lib/pq/service.ts +++ b/lib/pq/service.ts @@ -5,7 +5,7 @@ import { CopyPqListInput, CreatePqListInput, copyPqListSchema, createPqListSchem import { unstable_cache } from "@/lib/unstable-cache"; import { filterColumns } from "@/lib/filter-columns"; import { getErrorMessage } from "@/lib/handle-error"; -import { asc, desc, ilike, inArray, and, gte, lte, not, or, eq, count,isNull,SQL, sql, lt, isNotNull} from "drizzle-orm"; +import { asc, desc, ilike, inArray, and, gte, lte, not, or, eq, ne, count,isNull,SQL, sql, lt, isNotNull} from "drizzle-orm"; import { z } from "zod" import { revalidateTag, unstable_noStore, revalidatePath} from "next/cache"; import { format } from "date-fns" @@ -2865,26 +2865,22 @@ function getInvestigationMethodLabel(method: string): string { // } export async function getQMManagers() { try { - // QM 역할이 할당된 사용자들을 조회 + // domain이 'partners'가 아니고, isActive가 true인 사용자만 조회 const qmUsers = await db .select({ id: users.id, name: users.name, email: users.email, - employeeNumber: users.employeeNumber, - deptName: users.deptName, isActive: users.isActive, }) .from(users) - .innerJoin(userRoles, eq(users.id, userRoles.userId)) - .innerJoin(roles, eq(userRoles.roleId, roles.id)) .where( and( - ilike(roles.name, "%QM%"), // "QM"이 포함된 역할명 - eq(users.isActive, true) // 활성 사용자만 + eq(users.isActive, true), + ne(users.domain, "partners") ) ) - .orderBy(users.name) + .orderBy(users.name); return { data: qmUsers, -- cgit v1.2.3