tap order 数据写入mysql
This commit is contained in:
parent
dc05a29ea8
commit
1f7f549951
@ -26,7 +26,8 @@ class TapTapReport:
|
|||||||
def build_report(self):
|
def build_report(self):
|
||||||
all = dict()
|
all = dict()
|
||||||
gameid_order = dict()
|
gameid_order = dict()
|
||||||
gameid_info = self.get_gameid_info()
|
# get 最新的gameid info数据
|
||||||
|
gameid_info = self.get_gameid_info(self.day)
|
||||||
for item in (self.day, self.bday):
|
for item in (self.day, self.bday):
|
||||||
b_d = self.split_order_data(item)
|
b_d = self.split_order_data(item)
|
||||||
for key in b_d:
|
for key in b_d:
|
||||||
@ -40,8 +41,6 @@ class TapTapReport:
|
|||||||
all.setdefault(key, {})['current_order'] = gameid_order[key].get(self.day, 301)
|
all.setdefault(key, {})['current_order'] = gameid_order[key].get(self.day, 301)
|
||||||
|
|
||||||
for key in gameid_info.keys():
|
for key in gameid_info.keys():
|
||||||
pdb.set_trace()
|
|
||||||
print(all[key])
|
|
||||||
all[key]['title'] = gameid_info[key]['title']
|
all[key]['title'] = gameid_info[key]['title']
|
||||||
all[key]['cate'] = gameid_info[key]['cate']
|
all[key]['cate'] = gameid_info[key]['cate']
|
||||||
all[key]['topic'] = gameid_info[key]['topic']
|
all[key]['topic'] = gameid_info[key]['topic']
|
||||||
@ -52,10 +51,23 @@ class TapTapReport:
|
|||||||
all[key]['sell'] = gameid_info[key]['sell']
|
all[key]['sell'] = gameid_info[key]['sell']
|
||||||
all[key]['review'] = gameid_info[key]['review']
|
all[key]['review'] = gameid_info[key]['review']
|
||||||
|
|
||||||
|
b_game_info = self.get_gameid_info(self.bday)
|
||||||
|
for key in all.keys():
|
||||||
|
if all[key].get('title', None):
|
||||||
|
all[key]['title'] = b_game_info[key]['title']
|
||||||
|
all[key]['cate'] = b_game_info[key]['cate']
|
||||||
|
all[key]['topic'] = b_game_info[key]['topic']
|
||||||
|
all[key]['score'] = b_game_info[key]['score']
|
||||||
|
all[key]['reserve'] = b_game_info[key]['reserve']
|
||||||
|
all[key]['watch'] = b_game_info[key]['watch']
|
||||||
|
all[key]['download'] = b_game_info[key]['download']
|
||||||
|
all[key]['sell'] = b_game_info[key]['sell']
|
||||||
|
all[key]['review'] = b_game_info[key]['review']
|
||||||
|
|
||||||
print(all)
|
print(all)
|
||||||
|
|
||||||
|
|
||||||
def get_gameid_info(self):
|
def get_gameid_info(self, day):
|
||||||
all_data = dict()
|
all_data = dict()
|
||||||
sql = f"""SELECT
|
sql = f"""SELECT
|
||||||
gameid,
|
gameid,
|
||||||
@ -72,7 +84,7 @@ class TapTapReport:
|
|||||||
FROM
|
FROM
|
||||||
v_event_25
|
v_event_25
|
||||||
where
|
where
|
||||||
"$part_date"='{self.day}'"""
|
"$part_date"='{day}'"""
|
||||||
data = self.tga.get_data(sql)
|
data = self.tga.get_data(sql)
|
||||||
if data:
|
if data:
|
||||||
for line in data:
|
for line in data:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user