Commit d18bba96 authored by zhangmeng's avatar zhangmeng

替换sql语句

parent e58c9a3f
......@@ -131,7 +131,7 @@ def send_file_email(file_path, data_str, email_group=[],
if __name__ == '__main__':
send_file_email("",'',sender="litao@igengmei.com",email_group=["litao@igengmei.com"],email_msg_body_str="test",title_str="test",cc_group=["litao@igengmei.com"],file="data.csv")
send_file_email("",'',sender="zhangmeng@igengmei.com",email_group=["zhangmeng@igengmei.com"],email_msg_body_str="test",title_str="test",cc_group=["zhangmeng@igengmei.com"],file="data.csv")
......
......@@ -21,13 +21,13 @@ def con_sql(sql):
return result
res_list = [("id","question_id","platform")]
sql = "select id,question_id,platform from api_answer where platform in (2,0,9)"
sql = "SELECT api_answer.question_id,api_answer.id from api_answer,api_question WHERE api_answer.question_id = api_question.id AND api_question.id > 478020"
result = con_sql(sql)
for r in result:
res_list.append(r)
import pandas
from maintenance.func_send_email_with_file import send_file_email
from crawler.maintenance.func_send_email_with_file import send_file_email
data = pandas.DataFrame(res_list)
data.to_excel("./data_file.xlsx")
send_file_email("", '', sender="zhangmeng@igengmei.com", email_group=["zhangmeng@igengmei.com"], email_msg_body_str="test",
......
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