diff --git a/api/api_v1/endpoints/report.py b/api/api_v1/endpoints/report.py index ec31f8f..cddcfcb 100644 --- a/api/api_v1/endpoints/report.py +++ b/api/api_v1/endpoints/report.py @@ -40,9 +40,9 @@ async def edit( """编辑报表""" res = await crud.report.update_one(db, {'_id': data_in.report_id, 'user_id': request.user.id}, {'$set': {'query': data_in.query, 'name': data_in.name, 'desc': data_in.desc}}) - #if not res.matched_count: - if res.matched_count: - return schemas.Msg(code=-1, msg='只能报表所有者编辑') + # if not res.matched_count: + # #if res.matched_count: + # return schemas.Msg(code=-1, msg='只能报表所有者编辑') return schemas.Msg(code=0, msg='ok', data='编辑成功') diff --git a/api/api_v1/endpoints/xquery.py b/api/api_v1/endpoints/xquery.py index ff9a6c2..a872064 100644 --- a/api/api_v1/endpoints/xquery.py +++ b/api/api_v1/endpoints/xquery.py @@ -106,13 +106,15 @@ async def ltv_model_sql( new_avgLtv=str(avgLtv).split('\n')[0].split(' ') new_avgLtv01=new_avgLtv[len(new_avgLtv)-1] - - _listData[f'sumpay_{i}'] = new_avgLtv01 + if new_avgLtv01 == 'NaN': + _listData[f'sumpay_{i}'] = '-' + else: + _listData[f'sumpay_{i}'] = new_avgLtv01 else: - _listData[f'sumpay_{i}']=0 + _listData[f'sumpay_{i}']='-' avgLtvlist = pd.Series(_listData) - _listname=[] + _listname=[] #计算总累计LTV最后一个值 for k, v in _listData.items(): if v !=0: