fix(高级搜索): 多选成员类型字段搜索

This commit is contained in:
shiziyuan9527 2022-06-21 17:04:53 +08:00 committed by f2c-ci-robot[bot]
parent 9616880d7a
commit e70b190d18
2 changed files with 2 additions and 6 deletions

View File

@ -84,10 +84,7 @@
select resource_id from custom_field_test_case 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>
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

@ -120,8 +120,7 @@ export default {
let value = component.value;
if (component.type === "multipleMember") {
try {
let str = JSON.stringify(component.value);
value = str.substring(1, str.length - 1);
value = JSON.stringify(component.value);
} catch (e) {
// nothing
}