|
@@ -441,12 +441,12 @@ cua.account_id IS NOT NULL
|
|
where report.stat_date between {start_date} and {end_date}
|
|
where report.stat_date between {start_date} and {end_date}
|
|
and report.advertiser_id={account_id}
|
|
and report.advertiser_id={account_id}
|
|
""".format(start_date=start_date, end_date=end_date, account_id=account_id)
|
|
""".format(start_date=start_date, end_date=end_date, account_id=account_id)
|
|
- print(sql)
|
|
|
|
TidbConn.upsert(conn=self.conn, sql_buff=sql)
|
|
TidbConn.upsert(conn=self.conn, sql_buff=sql)
|
|
self.conn.commit()
|
|
self.conn.commit()
|
|
TidbConn.conn_close(conn=self.conn)
|
|
TidbConn.conn_close(conn=self.conn)
|
|
|
|
+ print(account_id, '快手账户日报执行完成')
|
|
except Exception as e:
|
|
except Exception as e:
|
|
- logging.error('失败详细信息:', repr(e))
|
|
|
|
|
|
+ logging.error(account_id, '执行失败')
|
|
|
|
|
|
def hourly_report(self, account_id, start_date, end_date):
|
|
def hourly_report(self, account_id, start_date, end_date):
|
|
try:
|
|
try:
|
|
@@ -873,12 +873,12 @@ cua.account_id IS NOT NULL
|
|
where report.stat_date between {start_date} and {end_date}
|
|
where report.stat_date between {start_date} and {end_date}
|
|
and report.advertiser_id={account_id}
|
|
and report.advertiser_id={account_id}
|
|
""".format(start_date=start_date, end_date=end_date, account_id=account_id)
|
|
""".format(start_date=start_date, end_date=end_date, account_id=account_id)
|
|
- print(sql)
|
|
|
|
TidbConn.upsert(conn=self.conn, sql_buff=sql)
|
|
TidbConn.upsert(conn=self.conn, sql_buff=sql)
|
|
self.conn.commit()
|
|
self.conn.commit()
|
|
TidbConn.conn_close(conn=self.conn)
|
|
TidbConn.conn_close(conn=self.conn)
|
|
|
|
+ print(account_id, '快手账户时报执行完成')
|
|
except Exception as e:
|
|
except Exception as e:
|
|
- logging.error('失败详细信息:', repr(e))
|
|
|
|
|
|
+ logging.error(account_id, '执行失败')
|
|
|
|
|
|
def handler(self, date_type, account_id, start_date, end_date):
|
|
def handler(self, date_type, account_id, start_date, end_date):
|
|
if date_type == "daily":
|
|
if date_type == "daily":
|