|
|
@@ -425,19 +425,10 @@ public class StoreUserServiceImpl extends ServiceImpl<StoreUserMapper, StoreUser
|
|
|
.collect(Collectors.toList());
|
|
|
}
|
|
|
|
|
|
- // 当id不为空时,通过中间表storePlatformUserRole判断是否为子账号(必须是子账号)
|
|
|
+ // 当id不为空时,对ID进行模糊查询(将ID转换为字符串进行模糊匹配)
|
|
|
if (StringUtils.isNotEmpty(id)) {
|
|
|
- Integer parsedId = safeParseInt(id);
|
|
|
- if (parsedId != null) {
|
|
|
- // 必须通过中间表判断,只有存在中间表中的才是子账号
|
|
|
- if (subAccountUserIds != null && subAccountUserIds.contains(parsedId)) {
|
|
|
- // 如果在中间表中存在,说明是子账号,添加ID条件
|
|
|
- subAccountWrapper.eq(StoreUser::getId, parsedId);
|
|
|
- } else {
|
|
|
- // 如果不在中间表中,添加一个无法匹配的条件,避免查询到非子账号
|
|
|
- subAccountWrapper.eq(StoreUser::getId, -1);
|
|
|
- }
|
|
|
- }
|
|
|
+ // 使用apply方法,将ID转换为字符串进行模糊查询
|
|
|
+ subAccountWrapper.apply("CAST(id AS CHAR) LIKE {0}", "%" + id + "%");
|
|
|
}
|
|
|
|
|
|
// 当phone不为空时,对子账号和主账号电话进行模糊查询,并关联storePlatformUserRole
|