This commit is contained in:
Àî×ÚÕñ 2022-09-19 17:32:18 +08:00
parent f0e2bdf289
commit d8f4f75f7b

View File

@ -375,12 +375,22 @@ class InterviewDo:
# 多个条件
if ',' in value:
values = value.split(',')
bast_index = len(values) - 1
for index, i in enumerate(values):
if index > 0:
if index == bast_index:
whereStr += 'or ' + str(key) + ' like ' + "'%" + i + "%'" + ') '
else:
whereStr += 'or ' + str(key) + ' like ' + "'%" + i + "%'" + ' '
else:
if whereStr:
if bast_index > 0:
whereStr += 'and (' + str(key) + ' like ' + "'%" + i + "%'" + ' '
else:
whereStr += 'and ' + str(key) + ' like ' + "'%" + i + "%'" + ' '
else:
if bast_index > 0:
whereStr += '(' + str(key) + ' like ' + "'%" + i + "%'" + ' '
else:
whereStr += str(key) + ' like ' + "'%" + i + "%'" + ' '
continue
@ -395,10 +405,10 @@ class InterviewDo:
if key == 'hr_manner':
if value == '':
if whereStr:
whereStr += 'and ' + str(key) + ' = ' + str(0) + ' '
whereStr += 'and (' + str(key) + ' = ' + str(0) + ' '
else:
whereStr += str(key) + ' = ' + str(0) + ' '
whereStr += 'or ' + str(key) + ' = ' + str(1) + ' '
whereStr += '(' + str(key) + ' = ' + str(0) + ' '
whereStr += 'or ' + str(key) + ' = ' + str(1) + ') '
if isinstance(value, str):
if not value.strip():
continue