|
@@ -25,13 +25,7 @@ class AccountDailyReport:
|
|
|
def daily_report(self):
|
|
|
ReplaceAccountInfo.handler()
|
|
|
try:
|
|
|
- sql = """select count(1) from media_api.kuaishou_account_report_daily where
|
|
|
- stat_date between {start_time} and {end_time}""".format(
|
|
|
- start_time=self.start_time, end_time=self.end_time)
|
|
|
- totalNum = TidbConn.quary(self.conn, sql)[0][0]
|
|
|
- pageCount = ceil(totalNum / 20000)
|
|
|
- for i in range(pageCount):
|
|
|
- sql = """
|
|
|
+ sql = """
|
|
|
replace into application.kuaishou_account_report_daily_dw
|
|
|
(account_id, stat_date, project_id, product_id, advertiser_id, company_id, account_name, project_name, advertiser_name,
|
|
|
company_name, sale_id, user_id, org_code, charge, `show`, photo_click, aclick, bclick, photo_click_ratio,
|
|
@@ -328,11 +322,10 @@ class AccountDailyReport:
|
|
|
`jeecg-boot`.ctop_account_attribution_info sys
|
|
|
on report.advertiser_id = sys.account_id
|
|
|
where report.stat_date between {start_time} and {end_time}
|
|
|
- order by account_id,stat_date limit {num},20000
|
|
|
- """.format(start_time=self.start_time, end_time=self.end_time,num=i * 20000)
|
|
|
- print(sql)
|
|
|
- TidbConn.upsert(conn=self.conn, sql_buff=sql)
|
|
|
- self.conn.commit()
|
|
|
+ """.format(start_time=self.start_time, end_time=self.end_time)
|
|
|
+ print(sql)
|
|
|
+ TidbConn.upsert(conn=self.conn, sql_buff=sql)
|
|
|
+ self.conn.commit()
|
|
|
TidbConn.conn_close(conn=self.conn)
|
|
|
return 0
|
|
|
except Exception as e:
|