From 2748627f184f1e96da9524bd4ec9566e54b48a82 Mon Sep 17 00:00:00 2001 From: youhuo Date: Mon, 19 Sep 2022 17:23:44 +0800 Subject: [PATCH] fix: tone case group sql --- app.properties | 6 +++--- models/tone_model.py | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app.properties b/app.properties index b3ce298..60b2dfe 100644 --- a/app.properties +++ b/app.properties @@ -17,15 +17,15 @@ formatter = %(asctime)s [%(process)d] [%(levelname)s] %(message)s formatter_access = %(asctime)s [%(process)d] [%(levelname)s] [%(host)s]: %(request)s %(message)s %(status)d %(byte)d # daily -db_url = mysql+aiomysql://root:123456@127.0.0.1:3306/test-lib +db_url = mysql+aiomysql://root:tonedbadmin@121.196.236.71:3306/test-lib drop_all = False -create_all = True +create_all = False pool_size = 10 over_size = 10 recycle = 3600 # redis -redis_url = redis://:123456@127.0.0.1:6379/10 +redis_url = redis://:toneredisadmin@121.196.236.71:6379/10 # tone prod tone_host = http://tone:7001/ diff --git a/models/tone_model.py b/models/tone_model.py index 80957c5..cf04040 100644 --- a/models/tone_model.py +++ b/models/tone_model.py @@ -48,7 +48,7 @@ async def get_total_suite_name(condition=None): select_orm = select(ToneCase.suite_id, ToneCase.suite_name, ToneCase.test_type, func.count(ToneCase.suite_name)) if len(condition) > 0: select_orm = select_orm.where(*condition) - select_orm = select_orm.group_by(ToneCase.suite_name) + select_orm = select_orm.group_by(ToneCase.suite_id, ToneCase.suite_name, ToneCase.test_type) async with db.conn() as session: results = await session.execute(select_orm) return [{'suite_id': result[0], 'suite_name': result[1], 'test_type': result[2], 'nums': result[3]} for result in -- Gitee