Browse Source

add fill date

ming 3 years ago
parent
commit
b1fc636df5
1 changed files with 7 additions and 2 deletions
  1. 7 2
      api/main.py

+ 7 - 2
api/main.py

@@ -102,10 +102,15 @@ def make_ci_df():
         ,'職稱':row['position'],'電話':row['phone'],"e-mail":row['email'],'已匯款,後五碼':row['cert_last5']
         ,'如何知道這個課程':row['where_learn'],'爲什麼想報名':row['why_sign'],'Line_ID':row['line_id'],'報名日期':fdate}, ignore_index=True)
     
+    cols = list(df.columns.values)
+    print(cols)
+    df = df[['報名日期', 'serial id','姓名','公司','職稱','電話','e-mail','已匯款,後五碼','如何知道這個課程','為什麼想報名','Line_ID']]
+    cols = list(df.columns.values)
+    print(cols)
     save_sheet(df,'client_info','result')
     
 def save_sheet(df,filename,tabname,startpos='A1'):
-    order = ['報名日期', 'serial id','姓名','公司','職稱','電話','e-mail','已匯款,後五碼','如何知道這個課程','為什麼想報名','Line_ID']
+
     scope = ['https://spreadsheets.google.com/feeds',
             'https://www.googleapis.com/auth/drive']
 
@@ -115,4 +120,4 @@ def save_sheet(df,filename,tabname,startpos='A1'):
     gc = gspread.authorize(credentials)
     spread = Spread(filename,creds=credentials)
 
-    spread.df_to_sheet(df, index=True, sheet=tabname, start=startpos, replace=True,freeze_index=True)
+    spread.df_to_sheet(df, index=True, sheet=tabname, start=startpos, replace=True, raw_columns=)