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

View File

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