Merge remote-tracking branch 'origin/conding' into conding
This commit is contained in:
@@ -131,4 +131,26 @@ def select_days(db):
|
||||
).filter(Employment_info.delete_status == 0).all()
|
||||
return l2
|
||||
except Exception:
|
||||
raise HTTPException(status_code=500, detail="查询异常")
|
||||
raise HTTPException(status_code=500, detail="查询异常")
|
||||
|
||||
|
||||
# 薪资区间分布:统计薪资在5k以下、5k-10k、10k-15k、15k以上的人数分布,反映学生的整体就业质量。
|
||||
def classify_salary(db):
|
||||
try:
|
||||
a=b=c=d=0
|
||||
l=db.query(Employment_info).filter(Employment_info.delete_status==0).all()
|
||||
for i in l:
|
||||
if i.salary is None:
|
||||
continue
|
||||
elif i.salary<5000:
|
||||
a+=1
|
||||
elif 5000<=i.salary<10000:
|
||||
b+=1
|
||||
elif 10000<=i.salary<15000:
|
||||
c+=1
|
||||
else:
|
||||
d+=1
|
||||
return {'5k以下': a, '5k-10k': b, '10k-15k': c, '15k': d}
|
||||
except:
|
||||
raise HTTPException(status_code=500,detail='查询异常!')
|
||||
|
||||
|
||||
Reference in New Issue
Block a user