From f744c68980515a230f31e91583df5e318aee7fd1 Mon Sep 17 00:00:00 2001 From: haotian <2421912570@qq.com> Date: Fri, 13 Jun 2025 14:41:10 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=20/event/getRobotList?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3,=20=E4=BF=AE=E6=94=B9=E6=9F=A5=E8=AF=A2?= =?UTF-8?q?=E6=9D=A1=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/api/v1/endpoints/events.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/api/v1/endpoints/events.py b/app/api/v1/endpoints/events.py index aa970a9..c5413ed 100644 --- a/app/api/v1/endpoints/events.py +++ b/app/api/v1/endpoints/events.py @@ -174,7 +174,8 @@ async def get_robot_list( query_1 = ( select(func.count()) .select_from(Message) - .where(and_(Message.handle=="0", Message.eventType=="1")) + .outerjoin(Event, Message.eventId == Event.eventId) + .where(Message.handle=="0", Message.eventType=="1", Event.number == robot.number) ) count_1 = await db.execute(query_1) @@ -185,7 +186,8 @@ async def get_robot_list( query_o = ( select(func.count()) .select_from(Message) - .where(and_(Message.handle=="0", Message.eventType!="1")) + .outerjoin(Event, Message.eventId == Event.eventId) + .where(Message.handle=="0", Message.eventType!="1", Event.number == robot.number) ) count_o = await db.execute(query_o)