|
@@ -20,13 +20,12 @@ class CampaignDailyReport:
|
|
|
self.conn = TidbConn.get_connection()
|
|
|
self.parm = Utils.get_args()
|
|
|
self.start_time = self.parm[0]
|
|
|
- self.end_time = self.parm[1]
|
|
|
|
|
|
def daily_report(self):
|
|
|
try:
|
|
|
sql = """select count(1) from media_api.kuaishou_campaign_report_daily where
|
|
|
- stat_date between {start_time} and {end_time}""".format(
|
|
|
- start_time=self.start_time, end_time=self.end_time)
|
|
|
+ stat_date = {start_time} """.format(
|
|
|
+ start_time=self.start_time)
|
|
|
totalNum = TidbConn.quary(self.conn, sql)[0][0]
|
|
|
pageCount = ceil(totalNum / 20000)
|
|
|
for i in range(pageCount):
|
|
@@ -232,8 +231,8 @@ WHERE
|
|
|
cua.account_id IS NOT NULL
|
|
|
) sys
|
|
|
on report.advertiser_id = sys.account_id
|
|
|
- where report.stat_date between {start_time} and {end_time} order by campaign_id,stat_date limit {num},20000""". \
|
|
|
- format(start_time=self.start_time, end_time=self.end_time, num=i * 20000)
|
|
|
+ where report.stat_date ={start_time} order by campaign_id,stat_date limit {num},20000""". \
|
|
|
+ format(start_time=self.start_time, num=i * 20000)
|
|
|
print(sql)
|
|
|
TidbConn.upsert(conn=self.conn, sql_buff=sql)
|
|
|
self.conn.commit()
|