fix(高级搜索): 缺陷按照多选框类型自定义字段搜索无效

--bug=1015257 --user=李玉号
【测试跟踪】缺陷模版添加自定义字段,字段类型“多选框”,使用该模版添加缺陷后,高级搜索,筛选该字段无效
https://www.tapd.cn/55049933/s/1210318
This commit is contained in:
shiziyuan9527 2022-07-25 17:08:17 +08:00 committed by shiziyuan9527
parent e4c64f39b3
commit dca129de0f
3 changed files with 4 additions and 7 deletions

View File

@ -293,11 +293,8 @@
and issues.id in (
select resource_id from custom_field_issues where field_id = #{custom.id}
<choose>
<when test="custom.type == 'multipleMember'">
<foreach item="item" collection='custom.value.split(",")' open="" separator="" close="">
and left(`value`, 1) = '['
and find_in_set(#{item}, replace(replace(`value`, ']', ''), '[', ''))
</foreach>
<when test="custom.type == 'multipleMember' or custom.type == 'checkbox' or custom.type == 'multipleSelect'">
and JSON_CONTAINS(`value`, #{custom.value})
</when>
<when test="custom.type == 'date' or custom.type == 'datetime'">
and left(replace(unix_timestamp(trim(both '"' from `value`)), '.', ''), 13)

View File

@ -111,7 +111,7 @@
and test_case.id in (
select resource_id from custom_field_test_case where field_id = #{custom.id}
<choose>
<when test="custom.type == 'multipleMember'">
<when test="custom.type == 'multipleMember' or custom.type == 'checkbox' or custom.type == 'multipleSelect'">
and JSON_CONTAINS(`value`, #{custom.value})
</when>
<when test="custom.type == 'date' or custom.type == 'datetime'">

View File

@ -125,7 +125,7 @@ export default {
condition['customs'] = [];
}
let value = component.value;
if (component.type === "multipleMember") {
if (component.type === "multipleMember" || component.type === "checkbox" || component.type === "multipleSelect") {
try {
value = JSON.stringify(component.value);
} catch (e) {