Explorar o código

2024-10-14
updateMinigramInfoDaily.py
line 42

use updateTime instead of createTime

罗俊辉 hai 9 meses
pai
achega
337d733191
Modificáronse 1 ficheiros con 4 adicións e 4 borrados
  1. 4 4
      updateMinigramInfoDaily.py

+ 4 - 4
updateMinigramInfoDaily.py

@@ -32,7 +32,7 @@ class DailyDataManager(object):
     @classmethod
     def get_published_articles(cls, biz_date):
         """
-        获取已经发布的文章的信息, createTime 选择为前一天的 0 点并且转化为时间戳
+        获取已经发布的文章的信息, updateTime 选择为前一天的 0 点并且转化为时间戳
         :return:
         """
         biz_date_midnight = datetime(year=biz_date.year, month=biz_date.month, day=biz_date.day)
@@ -41,7 +41,7 @@ class DailyDataManager(object):
         sql2 = f"""
         select ContentUrl, wx_sn, updateTime
         from official_articles_v2
-        where createTime between {biz_date_ts} and {biz_date_end_ts};
+        where updateTime between {biz_date_ts} and {biz_date_end_ts};
 --         and accountName in (
 --                         select distinct account_name from account_avg_info_v2
 --                         );
@@ -61,8 +61,8 @@ class DailyDataManager(object):
         :return:
         """
         try:
-            wx_sn, mini_info, create_time = cls.get_root_source_ids(line)
-            dt_object = datetime.fromtimestamp(create_time)
+            wx_sn, mini_info, update_time = cls.get_root_source_ids(line)
+            dt_object = datetime.fromtimestamp(update_time)
             publish_dt = dt_object.strftime('%Y-%m-%d')
             one_day = timedelta(days=1)
             two_day = timedelta(days=2)