fix(role): 修复角色删除按 auth_ids 查用户的子串混淆(like→FIND_IN_SET)

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
This commit is contained in:
augushong
2026-07-17 23:33:11 +08:00
parent 62a17647e1
commit 17ef7af860

View File

@@ -39,7 +39,7 @@ class AdminRoleDeleteBase extends Command
return false; return false;
} }
$checkUsers = SystemAdmin::where('auth_ids', 'like', '%' . $roleId . '%') $checkUsers = SystemAdmin::whereRaw('FIND_IN_SET(:roleId, auth_ids)', ['roleId' => $roleId])
->where('delete_time', 0) ->where('delete_time', 0)
->count(); ->count();