|
@@ -141,14 +141,15 @@ class ChannelSummary(BaseHandler):
|
|
|
data,total,total_data=get_channel_summary(channel,pitcher,page,page_size,order_by,order,state,location,start,end)
|
|
|
# print(data)
|
|
|
if arg.get("download"):
|
|
|
- # self.set_header('Content-Type', 'application/x-xls')
|
|
|
- # self.set_header('Content-Disposition',
|
|
|
- # f'attachment; filename=公众号总数据_{time.time()}.xls')
|
|
|
- self.set_header("Content-Type", "text/csv")
|
|
|
- self.set_header('Cache-Control', 'public, max-age=4320000000')
|
|
|
-
|
|
|
+ self.set_header('Content-Type', 'application/octet-stream')
|
|
|
+ self.set_header('Content-Disposition', 'attachment; filename=1.csv')
|
|
|
+ self.set_header("Pargam", "no-cache")
|
|
|
+ self.set_header("Cache-Control", "no-cache")
|
|
|
df = pd.DataFrame(data).to_csv(encoding='utf-8')
|
|
|
# print(df)
|
|
|
+ # with open(f'./{pitcher}_{start}_{end}.csv','w',newline='') as f:
|
|
|
+ # f.write(df)
|
|
|
+
|
|
|
self.write(df)
|
|
|
|
|
|
else:
|