diff --git a/api/api_v1/endpoints/query.py b/api/api_v1/endpoints/query.py index 65fafc4..a3aa5c6 100644 --- a/api/api_v1/endpoints/query.py +++ b/api/api_v1/endpoints/query.py @@ -1557,7 +1557,14 @@ async def scatter_model( if where == "step_id" and event_type == "guide": sql = f"""SELECT toDate(addHours({game}.event."#event_time", 8)) AS date, count(DISTINCT {game}.event."#account_id") AS values FROM {game}.event WHERE addHours({game}.event."#event_time", 8) >= '{start_date}' AND addHours({game}.event."#event_time", 8) <= '{end_date}' AND {game}.event."#event_name" = 'create_account' GROUP BY toDate(addHours({game}.event."#event_time", 8)) ORDER BY date""" df = await ckdb.query_dataframe(sql) + # for kk, ste_df in df.groupby('date'): + # if str(kk) not in resp['list']: + # continue + # value_list = ste_df.iloc[:, -1].to_list() + # resp['list'][str(kk)]['总体']['total'] = int(sum(value_list)) for i in range(len(df)): + if str(df['date'][i]) not in resp['list']: + continue resp['list'][str(df['date'][i])]['总体']['total'] = int(df['values'][i]) # 兼容下载功能 download = analysis.event_view.get('download', '')