From 462844e16ead697d20d4cc10118eb3b5fce8a3b6 Mon Sep 17 00:00:00 2001 From: apan Date: Fri, 5 Aug 2022 15:13:07 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=92=E8=89=B2=E6=9D=83=E9=99=90=E7=AE=A1?= =?UTF-8?q?=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- db_logic/module_relation.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/db_logic/module_relation.py b/db_logic/module_relation.py index 800f34e..a968306 100644 --- a/db_logic/module_relation.py +++ b/db_logic/module_relation.py @@ -64,10 +64,10 @@ class BllModuleRelation(Repository): def get_role_module_list(self, role_id): sql_all = f""" - SELECT a.module_id, b.module_code, b.sort_index, b.module_name - from rms_module_relation as a - LEFT JOIN rms_module as b on a.module_id=b.module_id - WHERE object_id='{role_id}' AND object_type=1 + select a.module_id, a.module_code, a.sort_index, a.module_name, a.module_type, + CASE WHEN b.object_id is NULL THEN 0 ELSE 1 END have from rms_module as a LEFT JOIN ( + select * from rms_module_relation WHERE object_id='{role_id}' and object_type=1 + ) b on a.module_id=b.module_id """ return self.execute(sql_all).fetchall()