查询兼容

This commit is contained in:
Àî×ÚÕñ 2022-09-16 14:27:44 +08:00
parent fd28355f0f
commit e35ea56a29
2 changed files with 18 additions and 1 deletions

View File

@ -161,7 +161,17 @@ async def interview_find(
return schemas.Msg(code=200, msg='无数据', data=[])
# 格式化数据
res_data = chkData(data)
return schemas.Msg(code=200, msg='ok', data=res_data)
# 统计数量
manner_2_num = len([1 for i in res_data if i['hr_manner'] == 2])
manner_01_num = len([1 for i in res_data if i['hr_manner'] in [0, 1]])
res_msg = {
'data': res_data,
'manner_2_num': manner_2_num,
'manner_01_num': manner_01_num,
}
return schemas.Msg(code=200, msg='ok', data=res_msg)
# 面试_主页初筛查询

View File

@ -312,9 +312,16 @@ class InterviewDo:
else:
whereStr += str(key) + ' like ' + "'%" + i + "%'" + ' '
continue
if value == '':
continue
# 单个条件
whereStr += str(key) + ' like ' + "'%" + value + "%'" + ' '
continue
if key == 'hr_manner':
if value == '':
whereStr += str(key) + ' = ' + str(0) + ' '
whereStr += 'or ' + str(key) + ' = ' + str(1) + ' '
if isinstance(value, str):
if not value.strip():
continue