统计分析模块更新,待测试,统计分析模块更新,就业3个模块更新。
This commit is contained in:
@@ -39,12 +39,23 @@ def get_class_count(g , db):
|
||||
from scores.model.score_model import Score
|
||||
|
||||
def get_score_80(db):
|
||||
q = ( db.query(Score)
|
||||
.group_by(Score.score)
|
||||
.having( min(Score.score) >= 80)
|
||||
sq = ( db.query(Students.id)
|
||||
.join(Score, Score.sid == Students.id)
|
||||
.filer(Score.score < 80 )
|
||||
.group_by(Students.id)
|
||||
.having(func.count(Score.id) > 2 )
|
||||
.sq()
|
||||
)
|
||||
|
||||
q = ( db.query(Students.name,ClassInfo.name,Score.score )
|
||||
.join(ClassInfo, ClassInfo.id == Students.class_id)
|
||||
.join(Score, Score.sid == Students.id)
|
||||
.filer(Students.id.in_(sq),Score.score < 80)
|
||||
.all()
|
||||
)
|
||||
return q
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user