This commit is contained in:
wuaho 2021-09-09 17:56:58 +08:00
parent 77ca70cc6c
commit 8d71ef15e1

View File

@ -34,7 +34,7 @@ class UserAnalysis:
self.date_range = None
self.unit_num = None
async def init(self):
async def init(self, *args, **kwargs):
if self.data_in.report_id:
db = get_database()
report = await crud.report.get(db, id=self.data_in.report_id)
@ -50,6 +50,9 @@ class UserAnalysis:
self.time_particle = self._get_time_particle_size()
self.groupby = self._get_group_by()
self.unit_num = self._get_unit_num()
# 用户自带过滤
if 'data_where' in kwargs:
self.global_filters.extend(kwargs['data_where'].get(self.game, []))
async def _init_table(self):
"""
@ -136,7 +139,7 @@ class UserAnalysis:
print(sql)
result = {'sql': sql,
'groupby': [i.key for i in self.groupby],
'quota':event['quota']
'quota': event['quota']
}
return result