|
@@ -18,7 +18,7 @@ class AppKuaishouMaterialProjectRelation:
|
|
|
def handler(self):
|
|
|
try:
|
|
|
sql = """select account_id from media_api.kuaishou_video_list
|
|
|
- and stat_date>=date_format(date_sub(now(),interval 3 day),'%Y-%m-%d')
|
|
|
+ where stat_date>=date_format(date_sub(now(),interval 7 day),'%Y-%m-%d')
|
|
|
group by account_id"""
|
|
|
account_list = TidbConn.quary(self.conn, sql)
|
|
|
for account_id in account_list:
|
|
@@ -28,14 +28,13 @@ class AppKuaishouMaterialProjectRelation:
|
|
|
select project_id, signature
|
|
|
from (select account_id, signature
|
|
|
from media_api.kuaishou_video_list where account_id ={account_id}
|
|
|
- and stat_date>=date_format(date_sub(now(),interval 3 day),'%Y-%m-%d')
|
|
|
+ and stat_date>=date_format(date_sub(now(),interval 7 day),'%Y-%m-%d')
|
|
|
and signature is not null
|
|
|
group by account_id, signature) a
|
|
|
left join
|
|
|
(select account_id, project_id from `jeecg-boot`.ctop_user_allocation where media_id = 2) b
|
|
|
on a.account_id = b.account_id
|
|
|
group by project_id, signature
|
|
|
-
|
|
|
""".format(account_id=account_id[0])
|
|
|
print(sql)
|
|
|
TidbConn.upsert(conn=self.conn, sql_buff=sql)
|