|
@@ -27,9 +27,22 @@ class send_material_report_weekly:
|
|
self.stat_date = (datetime.date.today() + datetime.timedelta(-1)).strftime("%Y%m%d")
|
|
self.stat_date = (datetime.date.today() + datetime.timedelta(-1)).strftime("%Y%m%d")
|
|
|
|
|
|
def handler(self):
|
|
def handler(self):
|
|
- sql = """select case when pro.agent_code=1 then '汇创'
|
|
|
|
- when pro.agent_code=2 then '骄阳'
|
|
|
|
- when pro.agent_code=3 then '华东' end AS '公司',
|
|
|
|
|
|
+ sql = """select (CASE
|
|
|
|
+ WHEN t1.clip_company_id = 'd57fecdcf7a94d009736d9c850731582' THEN '北京汇创思拓数字科技有限公司'
|
|
|
|
+ WHEN t1.clip_company_id = '6608ed13c0dd42de93c790dbdf124234' THEN
|
|
|
|
+'广州汇创思拓数字科技有限公司'
|
|
|
|
+WHEN t1.clip_company_id = '4b10089775c040119e139087517aed88' THEN
|
|
|
|
+'上海汇创思拓数字科技有限公司'
|
|
|
|
+WHEN t1.clip_company_id = '5e46b5dea3d740eeb8ff1a2895015a4b' THEN
|
|
|
|
+'北京骄阳数字科技有限公司'
|
|
|
|
+WHEN t1.clip_company_id = '1648c7ceb4d449a9a13fbed7a8d9976c' THEN
|
|
|
|
+'杭州妙构思数字科技有限公司'
|
|
|
|
+WHEN t1.clip_company_id = '3321d5893bcd430cab1238a99bc7db11' THEN
|
|
|
|
+'北京次元像素'
|
|
|
|
+ WHEN t1.clip_company_id='ace886fa51a244818e918b5d6d1bcc62' then
|
|
|
|
+ '北京聚意创量文化传媒有限公司'
|
|
|
|
+else '-'
|
|
|
|
+END) as '公司',
|
|
ifnull(t1.project_name,'-') AS '项目',
|
|
ifnull(t1.project_name,'-') AS '项目',
|
|
ifnull(t1.signature,'-') AS '素材标识',
|
|
ifnull(t1.signature,'-') AS '素材标识',
|
|
ifnull(t3.media_time,'-') AS '上线时间',
|
|
ifnull(t3.media_time,'-') AS '上线时间',
|
|
@@ -59,7 +72,7 @@ group by t1.signature; """.format(stat_date=self.stat_date)
|
|
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' # 发件人邮箱授权码 / 腾讯企业邮箱请使用登陆密码
|
|
- recipients = ['wanglei@c-top.com.cn', 'niuxiaoyu@c-top.com.cn', 'dukexuan@c-top.com.cn', 'yangyan@c-top.com.cn',
|
|
|
|
|
|
+ recipients = ['wanglei@c-top.com.cn', 'niuxiaoyu@c-top.com.cn', 'yangyan@c-top.com.cn',
|
|
'zhangnannan@c-top.com.cn'] # 收件人邮箱账号
|
|
'zhangnannan@c-top.com.cn'] # 收件人邮箱账号
|
|
# content = "Please check the attachment. "
|
|
# content = "Please check the attachment. "
|
|
msg = MIMEMultipart()
|
|
msg = MIMEMultipart()
|