Commit 33470420 by fangxingjun

no message

parent acf33c33
...@@ -21,7 +21,7 @@ class ImportStToPg14(object): ...@@ -21,7 +21,7 @@ class ImportStToPg14(object):
self.df_st_month = pd.DataFrame() self.df_st_month = pd.DataFrame()
self.df_st_month_state = pd.DataFrame() self.df_st_month_state = pd.DataFrame()
self.df_save = pd.DataFrame() self.df_save = pd.DataFrame()
self.fetch_year_month_by_week() # 如果传的date_type='week', 将date_info转换成月的值 # self.fetch_year_month_by_week() # 如果传的date_type='week', 将date_info转换成月的值
self.year, self.month = self.date_info.split("-")[0], int(self.date_info.split("-")[1]) self.year, self.month = self.date_info.split("-")[0], int(self.date_info.split("-")[1])
def fetch_year_month_by_week(self): def fetch_year_month_by_week(self):
...@@ -31,6 +31,7 @@ class ImportStToPg14(object): ...@@ -31,6 +31,7 @@ class ImportStToPg14(object):
self.date_info = list(df.year_month)[0] self.date_info = list(df.year_month)[0]
def read_data(self): def read_data(self):
self.fetch_year_month_by_week() # 如果传的date_type='week', 将date_info转换成月的值
# 1. 读取date_20_to_30表获取月份对应的周 # 1. 读取date_20_to_30表获取月份对应的周
sql_get_week = f"select year_week, year, week from selection.date_20_to_30 WHERE `year_month`='{self.date_info}' and week_day=1" sql_get_week = f"select year_week, year, week from selection.date_20_to_30 WHERE `year_month`='{self.date_info}' and week_day=1"
df_week = pd.read_sql(sql_get_week, con=self.engine_mysql) df_week = pd.read_sql(sql_get_week, con=self.engine_mysql)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment