v2.0.1更新
This commit is contained in:
@@ -68,6 +68,11 @@ class SubjectService:
|
||||
@staticmethod
|
||||
async def delete_subject(subject_id: int) -> Dict[str, Any]:
|
||||
"""删除科目(软删除)"""
|
||||
# 检查科目是否有关联数据
|
||||
has_data = await SubjectModel.has_related_data(subject_id)
|
||||
if has_data:
|
||||
return {"success": False, "message": "该科目下已有作业数据,无法删除"}
|
||||
|
||||
result = await SubjectModel.delete(subject_id)
|
||||
|
||||
if result:
|
||||
|
||||
Reference in New Issue
Block a user