This commit is contained in:
he
2026-09-21 21:40:48 +08:00
parent 85c3cc6508
commit c391bf2ebd
3 changed files with 15 additions and 16 deletions
+4 -3
View File
@@ -9,6 +9,7 @@ def get_grade_dao( stu_id:int , db):
r1 =db.query(WlScore).filter(WlScore.stu_id == stu_id,WlScore.delete_status == 0).all()
if r1:
return r1
else:
raise HTTPException(status_code=404,detail="学生不存在")
@@ -21,15 +22,15 @@ def add_grade_dao(g,db):
return o1
except Exception:
db.rollback()
return None
raise HTTPException(status_code=500,detail="学生添加失败")
def update_grade_dao(score_id:int, update_data, db):
try:
rows = db.query(WlScore).filter(
WlScore.stu_id == score_id,
WlScore.score_id == score_id,
WlScore.delete_status == 0
).update(update_data)
except:
except Exception:
db.rollback()
return False
else: