Commit d70c557a authored by 赵威's avatar 赵威

update write db

parent 825cad2e
...@@ -420,15 +420,19 @@ def get_tag3_user_log(cl_id): ...@@ -420,15 +420,19 @@ def get_tag3_user_log(cl_id):
# ) # )
def write_user_portrait(cl_id, first_solutions, second_solutions, first_demands, second_demands, def write_user_portrait(cl_id, first_solutions, second_solutions, first_demands, second_demands,
first_positions, second_positions, projects): first_positions, second_positions, projects):
today = datetime.date.today() try:
oneday = datetime.timedelta(days=1) today = datetime.date.today()
yesterday = today - oneday oneday = datetime.timedelta(days=1)
sql = """insert into user_tag3_portrait values(null, '{}', '{}', '{}', '{}', '{}', '{}', '{}', '{}', '{}')""".format( yesterday = today - oneday
yesterday, cl_id, first_solutions, second_solutions, first_demands, second_demands, first_positions, sql = """insert into user_tag3_portrait values(null, '{}', '{}', '{}', '{}', '{}', '{}', '{}', '{}', '{}')""".format(
second_positions, projects) yesterday, cl_id, first_solutions, second_solutions, first_demands, second_demands, first_positions,
second_positions, projects)
db, cursor = get_jerry_test()
cursor.execute(sql) db, cursor = get_jerry_test()
db.commit() cursor.execute(sql)
db.close() db.commit()
cursor.close() db.close()
cursor.close()
except Exception as e:
print("write db error")
print(e)
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