diff --git a/api/api_v1/endpoints/query.py b/api/api_v1/endpoints/query.py index f8f6d04..98eec1b 100644 --- a/api/api_v1/endpoints/query.py +++ b/api/api_v1/endpoints/query.py @@ -149,7 +149,10 @@ async def event_model( ) -> schemas.Msg: """ 事件分析""" await analysis.init(data_where=current_user.data_where) - sqls = await analysis.event_model_sql() + try: + sqls = await analysis.event_model_sql() + except Exception as e: + return schemas.Msg(code=-9, msg='报表配置参数异常') res = [] is_hide = [] diff --git a/api/api_v1/endpoints/xquery.py b/api/api_v1/endpoints/xquery.py index fa7c940..44e84f0 100644 --- a/api/api_v1/endpoints/xquery.py +++ b/api/api_v1/endpoints/xquery.py @@ -55,7 +55,10 @@ async def ltv_model_sql( sql = res['sql'] #仅一条筛选条件则是把GM过滤后获取全部数据 if len(analysis.global_filters)==1 and analysis.global_filters[0]['strftv']=='GM': - df = await ckdb.query_dataframe(sql) + try: + df = await ckdb.query_dataframe(sql) + except Exception as e: + return schemas.Msg(code=-9, msg='报表配置参数异常') #多条筛选条件则合成新的sql else: new_sql=""""""