添加daily report生成

This commit is contained in:
pengtao 2019-10-22 14:37:48 +08:00
parent 4eee7cba58
commit cf29f3bf71

View File

@ -248,14 +248,17 @@ class Report:
and "jump_appid"='{jump_appid}'
and "jump_result"=1 """
try:
jump_num, jump_pre = self.tga.get_data(jump_sql)[0]
return (jump_appid, FROMAPPID_CN.get(jump_appid, None), jump_num, jump_pre)
except Exception:
log.error(f"get data from output by {self.gameid} {jump_appid} failed", exc_info=True)
data = self.tga.get_data(jump_sql)
if data:
try:
jump_num, jump_pre = data[0]
return (jump_appid, FROMAPPID_CN.get(jump_appid, None), jump_num, jump_pre)
except Exception:
log.error(f"get data from output by {self.gameid} {jump_appid} failed", exc_info=True)
return None
else:
return None
def run(self):
data = dict()
data['day'] = self.day
@ -267,11 +270,11 @@ class Report:
data['output'] = []
fromappids = FROMAPPID_CN.keys()
for fromappid in fromappids:
pdb.set_trace()
data['input'].append(self.get_input_fromappid(fromappid))
data['output'].append(self.get_output_fromappid(fromappid))
print(data)
print(data)