|
@@ -21,8 +21,14 @@ class AppBytedanceVideoReportBusi:
|
|
|
|
|
|
def taskHandler(self):
|
|
|
try:
|
|
|
- sql_porject = """select account_id from `jeecg-boot`.ctop_user_allocation where media_id=1
|
|
|
-group by account_id """
|
|
|
+ sql_porject = """select advertiser_id from media_api.bytedance_material_report_daily zhubiao
|
|
|
+ WHERE image_mode IN (
|
|
|
+ 'CREATIVE_IMAGE_MODE_VIDEO',
|
|
|
+ 'CREATIVE_IMAGE_MODE_VIDEO_VERTICAL',
|
|
|
+ 'CREATIVE_IMAGE_MODE_UNION_SPLASH_VIDEO'
|
|
|
+ )
|
|
|
+ AND stat_datetime >= date_format( date_sub({date_time}, INTERVAL ({day_count} -1 ) DAY),'%Y%m%d')
|
|
|
+group by advertiser_id """.format(date_time=self.date_time, day_count=self.day_count)
|
|
|
account_list = TidbConn.quary(self.conn, sql_porject)
|
|
|
for account_id in account_list:
|
|
|
try:
|
|
@@ -493,8 +499,8 @@ FROM (
|
|
|
on report.account_id = ratio.account_id and report.material_id = ratio.material_id
|
|
|
where cua.account_id = {account_id};
|
|
|
""".format(date_time=self.date_time,
|
|
|
- day_count=self.day_count,
|
|
|
- account_id=account_id[0])
|
|
|
+ day_count=self.day_count,
|
|
|
+ account_id=account_id[0])
|
|
|
TidbConn.upsert(conn=self.conn, sql_buff=sql)
|
|
|
self.conn.commit()
|
|
|
except Exception as e:
|