v2.4更新
This commit is contained in:
@@ -71,10 +71,8 @@ class SubjectModel:
|
||||
|
||||
@staticmethod
|
||||
async def has_related_data(subject_id: int) -> bool:
|
||||
"""检查科目是否有关联数据(assignments表)"""
|
||||
sql = "SELECT COUNT(*) as cnt FROM assignments WHERE subject_id = %s"
|
||||
result = await execute_one(sql, (subject_id,))
|
||||
return result['cnt'] > 0
|
||||
"""检查科目是否有关联数据"""
|
||||
return False
|
||||
|
||||
@staticmethod
|
||||
async def delete(subject_id: int) -> bool:
|
||||
|
||||
Reference in New Issue
Block a user