From 1364c737efa448d24857e39fa54b5efdfe8d88f2 Mon Sep 17 00:00:00 2001 From: logan Date: Wed, 3 Jun 2026 02:06:20 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=B7=A5=E5=8D=95=E5=88=97=E8=A1=A8?= =?UTF-8?q?=E6=9D=83=E9=99=90=E8=BF=87=E6=BB=A4-developer/auditor=E4=B9=9F?= =?UTF-8?q?=E8=83=BD=E7=9C=8B=E5=88=B0=E5=BE=85=E5=AE=A1=E5=B7=A5=E5=8D=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - developer之前只能看applicant_id=自己的工单,导致审批人看不到待审工单 - 改为admin看全部,其他角色(包括developer/dba/auditor)都能看到自己提交+自己作为审批人的工单 - E2E全流程验证通过: testtest提交→test123初审→test234复审→admin执行→success --- backend/internal/handler/ticket.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/backend/internal/handler/ticket.go b/backend/internal/handler/ticket.go index bae87a2..2525df0 100644 --- a/backend/internal/handler/ticket.go +++ b/backend/internal/handler/ticket.go @@ -84,9 +84,9 @@ func ListTickets(c *gin.Context) { // Filter by user role switch role { - case "developer": - query = query.Where("applicant_id = ?", userID) - case "dba", "auditor": + case "admin": + // admin sees all tickets + default: query = query.Where( "applicant_id = ? OR id IN (SELECT ticket_id FROM ticket_approvals WHERE approver_id = ?)", userID, userID,