fix(组织成员): 修复组织成员搜索报错问题

This commit is contained in:
guoyuqi 2024-02-01 09:56:00 +08:00 committed by f2c-ci-robot[bot]
parent e57f462e38
commit db5182f37d
2 changed files with 9 additions and 8 deletions

View File

@ -101,11 +101,11 @@
<select id="selectListMemberByOrg" resultType="io.metersphere.system.dto.OptionDisabledDTO">
select u.id, u.name
from user u
where u.deleted = 0
where u.deleted = false
<if test="keyword != null and keyword != ''">
and (u.name like CONCAT('%', #{request.keyword},'%')
or u.email like CONCAT('%', #{request.keyword},'%')
or u.phone like CONCAT('%', #{request.keyword},'%'))
and (u.name like CONCAT('%', #{keyword},'%')
or u.email like CONCAT('%', #{keyword},'%')
or u.phone like CONCAT('%', #{keyword},'%'))
</if>
order by u.update_time desc
limit 100

View File

@ -1,17 +1,17 @@
package io.metersphere.system.controller;
import io.metersphere.system.base.BaseTest;
import io.metersphere.sdk.constants.InternalUserRole;
import io.metersphere.sdk.constants.SessionConstants;
import io.metersphere.system.controller.handler.ResultHolder;
import io.metersphere.system.dto.sdk.OptionDTO;
import io.metersphere.sdk.util.JSON;
import io.metersphere.system.utils.Pager;
import io.metersphere.system.base.BaseTest;
import io.metersphere.system.controller.handler.ResultHolder;
import io.metersphere.system.dto.OrgUserExtend;
import io.metersphere.system.dto.request.OrgMemberExtendProjectRequest;
import io.metersphere.system.dto.request.OrganizationMemberExtendRequest;
import io.metersphere.system.dto.request.OrganizationMemberUpdateRequest;
import io.metersphere.system.dto.request.OrganizationRequest;
import io.metersphere.system.dto.sdk.OptionDTO;
import io.metersphere.system.utils.Pager;
import jakarta.annotation.Resource;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
@ -432,6 +432,7 @@ public class OrganizationControllerTests extends BaseTest {
MvcResult mvcResult = mockMvc.perform(MockMvcRequestBuilders.get("/organization/not-exist/user/list/sys_default_organization_3")
.header(SessionConstants.HEADER_TOKEN, sessionId)
.header(SessionConstants.CSRF_TOKEN, csrfToken)
.param("keyword", "test")
.contentType(MediaType.APPLICATION_JSON))
.andExpect(status().isOk())
.andExpect(content().contentType(MediaType.APPLICATION_JSON)).andReturn();