新增周报脚本
This commit is contained in:
parent
ba2f7ce4b7
commit
4e7de25c4c
@ -4,6 +4,7 @@ from ops.plog import define_logger
|
||||
import logging
|
||||
import datetime
|
||||
import json
|
||||
from collections import defaultdict
|
||||
define_logger("/data/logs/ops/tap_weekly.log")
|
||||
|
||||
db_conf = {'user': 'mytga', 'pswd': 'gzVwh4HGR68G', 'host': '10.10.3.5', 'db': 'external_data'}
|
||||
@ -27,6 +28,7 @@ class TapWeeklyReport:
|
||||
def build(self):
|
||||
weekly_day = json.dumps(self.get_weekly_days()).strip('[]')
|
||||
tap_types = ("new", "download", "reserve", "sell", "played")
|
||||
all_data = defaultdict(list)
|
||||
for tap_type in tap_types:
|
||||
sql = f"""select
|
||||
gameid,
|
||||
@ -44,8 +46,8 @@ class TapWeeklyReport:
|
||||
|
||||
data = self.db_conn.query(sql)
|
||||
if data:
|
||||
print(f"{tap_type}\t{data}")
|
||||
return True
|
||||
all_data[tap_type].append(data) # print(f"{tap_type}\t{data}")
|
||||
return all_data
|
||||
|
||||
def run(self):
|
||||
data = self.build()
|
||||
|
Loading…
x
Reference in New Issue
Block a user