diff --git a/api/api_v1/endpoints/xquery.py b/api/api_v1/endpoints/xquery.py index af9be2c..d7a6de5 100644 --- a/api/api_v1/endpoints/xquery.py +++ b/api/api_v1/endpoints/xquery.py @@ -48,7 +48,7 @@ async def ltv_model_sql( df.fillna(0, inplace=True) df.rename(columns={'date': '注册日期', 'cnt1': '角色数'}, inplace=True) data = { - 'titel': df.columns.tolist(), + 'title': df.columns.tolist(), 'rows': df.values.tolist() } diff --git a/models/x_analysis.py b/models/x_analysis.py index 30f4f3f..bd01baa 100644 --- a/models/x_analysis.py +++ b/models/x_analysis.py @@ -103,7 +103,7 @@ class XAnalysis: qry = sa.select().where(*where, *where_ext) sql = str(qry.compile(compile_kwargs={"literal_binds": True})) where_str = sql.split('WHERE ')[1] - sql = f"""SELECT toYYYYMMDD(reg.date) as date, + sql = f"""SELECT toString(reg.date) as date, cnt1, {select_ltv_str} FROM (SELECT toDate(addHours(`#event_time`, `#zone_offset`)) as date, uniqExact(`#account_id`) cnt1