diff --git a/StatCalc/api/statcalc_api.py b/StatCalc/api/statcalc_api.py index d82bf7b..79a352b 100644 --- a/StatCalc/api/statcalc_api.py +++ b/StatCalc/api/statcalc_api.py @@ -74,10 +74,10 @@ def salarytop5(num:int,db=Depends(get_db)): return [{'学生姓名': row[2], '学生班级编号': row[3], '就业时间': str(row[0].offer_recived_time) if row[0].offer_recived_time else None, '公司': row[1]} for row in q] @statcalc_api.get('/statcalc/job',summary='学生就业时长') -def worktime(db=Depends(get_db)): +def worktime(stuid:int,db=Depends(get_db)): q = db.query(Employments, Students.name.label('sname')) \ .join(Students, Employments.stuid == Students.id) \ - .filter(Employments.is_deleted == 0) \ + .filter(Employments.stuid == stuid,Employments.is_deleted == 0) \ .all() return [