fix: 银行存款可见性改为动态读取超管等级(superlevel)而非固定id=1

This commit is contained in:
2026-03-21 16:40:37 +08:00
parent e42dc5fbfa
commit cbc4d3b7d0

View File

@@ -66,10 +66,11 @@ class UserController extends Controller
$data['meili'] = $targetUser->meili ?? 0;
}
// 银行存款:只有超级管理员(id=1)或本人才能查看具体金额,其余一律显示星号
// 银行存款:只有超级管理员(user_level >= superlevel)或本人才能查看具体金额,其余一律显示星号
if ($operator) {
$isSelf = $operator->id === $targetUser->id;
$isSuperAdmin = $operator->id === 1;
$superLevel = (int) \App\Models\Sysparam::getValue('superlevel', '100');
$isSuperAdmin = $operator->user_level >= $superLevel;
$data['bank_jjb'] = ($isSelf || $isSuperAdmin)
? ($targetUser->bank_jjb ?? 0)
: '******';