排序
This commit is contained in:
parent
0206d806a4
commit
5aa35c7bdd
@ -1161,11 +1161,22 @@ async def find_mode_tables(
|
||||
"""获取一条hr分组包含的报表"""
|
||||
mode_data = await crud.api_interview_modes.get_one_mode(db, data_in.mode_id)
|
||||
table_data = []
|
||||
new_table_data = []
|
||||
if mode_data:
|
||||
tables = mode_data['mode_list']
|
||||
if tables:
|
||||
table_data = await crud.api_interview_tables.get_tables(db, {'table_id': {'$in': tables}})
|
||||
return schemas.Msg(code=200, msg='ok', data=table_data)
|
||||
if table_data:
|
||||
for data in table_data:
|
||||
table_id = data.get('table_id')
|
||||
sort_key = tables.index(table_id)
|
||||
data.update({'sort_key': sort_key})
|
||||
new_data = deepcopy(data)
|
||||
new_table_data.append(new_data)
|
||||
if new_table_data:
|
||||
new_table_data.sort(key=lambda i: i.get('sort_key'))
|
||||
|
||||
return schemas.Msg(code=200, msg='ok', data=new_table_data)
|
||||
|
||||
|
||||
@router.post("/update_mode")
|
||||
@ -2222,11 +2233,11 @@ async def interviews(
|
||||
res1 = chkData(data1)
|
||||
data2 = await ckdb.execute(sql2)
|
||||
res2 = chkData(data2)
|
||||
res3=[]
|
||||
datas={'later':res, # 今天及之后的面试
|
||||
'teacher_true':res1, # 已反馈的面试
|
||||
'later_false':res2, # 未反馈的面试
|
||||
'later_invalid':res3} # 已失效的面试
|
||||
res3 = []
|
||||
datas = {'later': res, # 今天及之后的面试
|
||||
'teacher_true': res1, # 已反馈的面试
|
||||
'later_false': res2, # 未反馈的面试
|
||||
'later_invalid': res3} # 已失效的面试
|
||||
|
||||
return schemas.Msg(code=200, msg='ok', data=datas)
|
||||
|
||||
@ -2259,6 +2270,6 @@ async def interview_teacher(
|
||||
""" 获取面试反馈 """
|
||||
sql = f"""select uid,teacher_back,teacher_txt from HR.resumes WHERE uid = '{data_in.uid}' limit 1"""
|
||||
print(sql)
|
||||
res=await ckdb.execute(sql)
|
||||
data=chkData(res)
|
||||
return schemas.Msg(code=200, msg='ok', data=data)
|
||||
res = await ckdb.execute(sql)
|
||||
data = chkData(res)
|
||||
return schemas.Msg(code=200, msg='ok', data=data)
|
||||
|
Loading…
Reference in New Issue
Block a user