renyupeng 1 년 전
부모
커밋
9148f68a03
3개의 변경된 파일8개의 추가작업 그리고 9개의 파일을 삭제
  1. 2 2
      Apietl/email/BytedanceHotMaterial.py
  2. 2 2
      Apietl/email/KuaishouHotMaterial.py
  3. 4 5
      Apietl/email/OpenWindowMaterial.py

+ 2 - 2
Apietl/email/BytedanceHotMaterial.py

@@ -2,7 +2,7 @@
 # coding=utf-8
 # @Time    : 2021/12/20 11:18 上午
 # @Site    :
-# @File    : NewKuaiShouAllMaterialFourD.py.py
+# @File    : BytedanceHotMaterial.py
 # @Software: PyCharm
 # @contact: renyupeng@c-top.com.cn
 # @Tel 1501435553
@@ -50,7 +50,7 @@ from (select material_id,
              video_url,
              material_innovate
       from application.app_bytedance_material_info
-      where faddish_date >= date_format(date_sub({stat_date}, INTERVAL 6 DAY), '%Y%m%d') AND faddish_date<={stat_date}
+      where faddish_date >= date_format(date_sub({stat_date}, INTERVAL 6 DAY), '%%Y%%m%%d') AND faddish_date<={stat_date}
         and company_id is not null) t1
          left join
          (select * from application.hot_material_two_week_cost where media_id = 1) t2

+ 2 - 2
Apietl/email/KuaishouHotMaterial.py

@@ -2,7 +2,7 @@
 # coding=utf-8
 # @Time    : 2021/12/20 11:18 上午
 # @Site    :
-# @File    : NewKuaiShouAllMaterialFourD.py.py
+# @File    : BytedanceHotMaterial.py
 # @Software: PyCharm
 # @contact: renyupeng@c-top.com.cn
 # @Tel 1501435553
@@ -94,4 +94,4 @@ order by hot_cost desc;
 
 
 if __name__ == '__main__':
-    TidbKuaiShouAllMaterialEffeW().handler()
+    KuaishouHotMaterial().handler()

+ 4 - 5
Apietl/email/OpenWindowMaterial.py

@@ -2,7 +2,7 @@
 # coding=utf-8
 # @Time    : 2021/12/20 11:18 上午
 # @Site    :
-# @File    : send_material_report_weekly.py.py
+# @File    : OpenWindowMaterial.py
 # @Software: PyCharm
 # @contact: renyupeng@c-top.com.cn
 # @Tel 1501435553
@@ -34,13 +34,12 @@ select project_name as '项目',
        sum(charge)  as '消耗',
        photo_url    as '素材链接'
 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)
         print(sql)
         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')
         my_sender = 'renyupeng@c-top.com.cn'  # 发件人邮箱账号
         my_pass = 'fcyJKkHUyPo6Zztw'  # 发件人邮箱授权码 / 腾讯企业邮箱请使用登陆密码