跨域bug修复2

This commit is contained in:
canglan committed 2026-04-14 15:56:57 +08:00
1 parent 74053bdbdc
commit fd3535f884
14 files changed
+65 -65

No files matched your search

+5 -7
View File
@@ -55,18 +55,17 @@ class StudentModel:
@staticmethod
async def create(
student_no: str,
name: str,
class_id: int,
student_no: str,
name: str,
parent_phone: str = None,
initial_points: int = 60
) -> int:
"""创建学生(初始操行分默认60分)"""
sql = """
INSERT INTO students (student_no, name, class_id, parent_phone, total_points)
VALUES (%s, %s, %s, %s, %s)
INSERT INTO students (student_no, name, parent_phone, total_points)
VALUES (%s, %s, %s, %s)
"""
return await execute_insert(sql, (student_no, name, class_id, parent_phone, initial_points))
return await execute_insert(sql, (student_no, name, parent_phone, initial_points))
@staticmethod
async def update(student_id: int, name: str = None, parent_phone: str = None, status: int = None) -> bool:
@@ -128,7 +127,6 @@ class StudentModel:
student_id = await StudentModel.create(
student_no=student.get('student_no'),
name=student.get('name'),
class_id=1, # 单班级,固定为1
parent_phone=student.get('parent_phone'),
initial_points=initial_points
)