|
@@ -2,7 +2,7 @@
|
|
# coding=utf-8
|
|
# coding=utf-8
|
|
# @Time : 2021/12/20 11:18 上午
|
|
# @Time : 2021/12/20 11:18 上午
|
|
# @Site :
|
|
# @Site :
|
|
-# @File : send_material_report_weekly.py.py
|
|
|
|
|
|
+# @File : OpenWindowMaterial.py
|
|
# @Software: PyCharm
|
|
# @Software: PyCharm
|
|
# @contact: renyupeng@c-top.com.cn
|
|
# @contact: renyupeng@c-top.com.cn
|
|
# @Tel 1501435553
|
|
# @Tel 1501435553
|
|
@@ -34,13 +34,12 @@ select project_name as '项目',
|
|
sum(charge) as '消耗',
|
|
sum(charge) as '消耗',
|
|
photo_url as '素材链接'
|
|
photo_url as '素材链接'
|
|
from application.kuaishou_material_video_report_daily_dw
|
|
from application.kuaishou_material_video_report_daily_dw
|
|
-where stat_date >= date_format(date_sub('{date}',interval 6 day),'%%Y%%m%%d')
|
|
|
|
- and stat_date <= date_format('{date}','%%Y%%m%%d')
|
|
|
|
- and video_name like '%开屏%'
|
|
|
|
|
|
+where stat_date >= date_format(date_sub({date},interval 6 day),'%%Y%%m%%d')
|
|
|
|
+ and stat_date <= {date}
|
|
|
|
+ and video_name like '%%开屏%%'
|
|
group by signature """.format(date=self.stat_date)
|
|
group by signature """.format(date=self.stat_date)
|
|
print(sql)
|
|
print(sql)
|
|
path = """/data/excel/开屏素材_{stat_date}.xls""".format(stat_date=self.stat_date)
|
|
path = """/data/excel/开屏素材_{stat_date}.xls""".format(stat_date=self.stat_date)
|
|
- print(path)
|
|
|
|
pd.read_sql(sql, self.OuterConn).to_excel(path, index=False, engine='openpyxl')
|
|
pd.read_sql(sql, self.OuterConn).to_excel(path, index=False, engine='openpyxl')
|
|
my_sender = 'renyupeng@c-top.com.cn' # 发件人邮箱账号
|
|
my_sender = 'renyupeng@c-top.com.cn' # 发件人邮箱账号
|
|
my_pass = 'fcyJKkHUyPo6Zztw' # 发件人邮箱授权码 / 腾讯企业邮箱请使用登陆密码
|
|
my_pass = 'fcyJKkHUyPo6Zztw' # 发件人邮箱授权码 / 腾讯企业邮箱请使用登陆密码
|