This commit is contained in:
wuaho 2021-08-30 17:30:31 +08:00
parent 078163290a
commit ed5055e2e2
2 changed files with 6 additions and 2 deletions

View File

@ -108,7 +108,9 @@ async def copy(
try:
await crud.report.insert_one(db, new_report)
except:
pass
exists_report = await crud.report.find_one(db, {'project_id': item['project_id'],
'user_id': item['user_id'], 'name': report['name']})
report['report_id'] = exists_report['_id']
try:
await crud.dashboard.update_one(db,
{'project_id': item['project_id'], 'name': item['name'],

View File

@ -226,6 +226,8 @@ async def retention_model(request: Request,
res = analysis.retention_model_sql2()
sql = res['sql']
df = await ckdb.query_dataframe(sql)
if len(df) == 0:
return schemas.Msg(code=-1, msg='无数据', data=None)
title = f'用户数'
date_range = res['date_range']