更新数据截止日2025.12.14

This commit is contained in:
lychang
2025-12-15 11:48:34 +08:00
parent fdfa3300fc
commit f0ee65fc53
5 changed files with 14 additions and 14 deletions

12
app.py
View File

@@ -1,7 +1,4 @@
from datetime import datetime, timedelta
from typing import Any
import requests
from flask import Flask, jsonify, request, render_template
import json
import os
@@ -853,11 +850,12 @@ def create_qa():
answer_ids = data.get('answer', [])
conn = db_manager.get_connection()
cursor = conn.cursor()
index_id = cursor.execute_query(f"SELECT id FROM qa order by id desc limit 1", fetch_all=False)[0]
index_id += 1
cursor.execute('''
INSERT INTO qa (groupId, question, answer, start_time, end_time)
VALUES (?, ?, ?, ?, ?)
''', (group_id, json.dumps(question_ids), json.dumps(answer_ids),
INSERT INTO qa ("id", "groupId", "question", "answer", "start_time", "end_time")
VALUES (?, ?, ?, ?, ?, ?)
''', (index_id, group_id, json.dumps(question_ids), json.dumps(answer_ids),
data.get('start_time', ''), data.get('end_time', '')))
conn.commit()