From 9865fed808f4cecc0fbe39a43a22dbf76edad67d Mon Sep 17 00:00:00 2001 From: xiaomlove Date: Fri, 7 Oct 2022 02:51:52 +0800 Subject: [PATCH] [admin] fix user link --- app/Filament/Resources/System/UsernameChangeLogResource.php | 2 +- app/Filament/Resources/User/ClaimResource.php | 2 +- app/Filament/Resources/User/ExamUserResource.php | 2 +- app/Filament/Resources/User/HitAndRunResource.php | 2 +- app/Filament/Resources/User/UserMedalResource.php | 2 +- include/constants.php | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/app/Filament/Resources/System/UsernameChangeLogResource.php b/app/Filament/Resources/System/UsernameChangeLogResource.php index 57e2cc47..aff1d66b 100644 --- a/app/Filament/Resources/System/UsernameChangeLogResource.php +++ b/app/Filament/Resources/System/UsernameChangeLogResource.php @@ -54,7 +54,7 @@ class UsernameChangeLogResource extends Resource Tables\Columns\TextColumn::make('username_new') ->searchable() ->label(__('username-change-log.labels.username_new')) - ->formatStateUsing(fn ($record) => new HtmlString(get_username($record->id, false, true, true, true))) + ->formatStateUsing(fn ($record) => new HtmlString(get_username($record->uid, false, true, true, true))) , Tables\Columns\TextColumn::make('operator') ->searchable() diff --git a/app/Filament/Resources/User/ClaimResource.php b/app/Filament/Resources/User/ClaimResource.php index f0b77c1f..0bc70183 100644 --- a/app/Filament/Resources/User/ClaimResource.php +++ b/app/Filament/Resources/User/ClaimResource.php @@ -52,7 +52,7 @@ class ClaimResource extends Resource Tables\Columns\TextColumn::make('user.username') ->label(__('label.user.label')) ->searchable() - ->formatStateUsing(fn ($record) => new HtmlString(get_username($record->id, false, true, true, true))) + ->formatStateUsing(fn ($record) => new HtmlString(get_username($record->uid, false, true, true, true))) , Tables\Columns\TextColumn::make('torrent.name')->limit(40)->label(__('label.torrent.label'))->searchable(), Tables\Columns\TextColumn::make('torrent.size')->label(__('label.torrent.size'))->formatStateUsing(fn (Model $record) => mksize($record->torrent->size)), diff --git a/app/Filament/Resources/User/ExamUserResource.php b/app/Filament/Resources/User/ExamUserResource.php index e8a2226b..9d439447 100644 --- a/app/Filament/Resources/User/ExamUserResource.php +++ b/app/Filament/Resources/User/ExamUserResource.php @@ -55,7 +55,7 @@ class ExamUserResource extends Resource Tables\Columns\TextColumn::make('user.username') ->label(__('label.username')) ->searchable() - ->formatStateUsing(fn ($record) => new HtmlString(get_username($record->id, false, true, true, true))) + ->formatStateUsing(fn ($record) => new HtmlString(get_username($record->uid, false, true, true, true))) , Tables\Columns\TextColumn::make('exam.name')->label(__('label.exam.label')), Tables\Columns\TextColumn::make('begin')->label(__('label.begin'))->dateTime(), diff --git a/app/Filament/Resources/User/HitAndRunResource.php b/app/Filament/Resources/User/HitAndRunResource.php index cca3645a..dc90ede1 100644 --- a/app/Filament/Resources/User/HitAndRunResource.php +++ b/app/Filament/Resources/User/HitAndRunResource.php @@ -46,7 +46,7 @@ class HitAndRunResource extends Resource Tables\Columns\TextColumn::make('user.username') ->searchable() ->label(__('label.username')) - ->formatStateUsing(fn ($record) => new HtmlString(get_username($record->id, false, true, true, true))) + ->formatStateUsing(fn ($record) => new HtmlString(get_username($record->uid, false, true, true, true))) , Tables\Columns\TextColumn::make('torrent.name')->limit(30)->label(__('label.torrent.label')), diff --git a/app/Filament/Resources/User/UserMedalResource.php b/app/Filament/Resources/User/UserMedalResource.php index c790aa38..9ef4f34b 100644 --- a/app/Filament/Resources/User/UserMedalResource.php +++ b/app/Filament/Resources/User/UserMedalResource.php @@ -51,7 +51,7 @@ class UserMedalResource extends Resource Tables\Columns\TextColumn::make('user.username') ->label(__('label.username')) ->searchable() - ->formatStateUsing(fn ($record) => new HtmlString(get_username($record->id, false, true, true, true))) + ->formatStateUsing(fn ($record) => new HtmlString(get_username($record->uid, false, true, true, true))) , Tables\Columns\TextColumn::make('medal.name')->label(__('label.medal.label'))->searchable(), Tables\Columns\ImageColumn::make('medal.image_large')->label(__('label.image')), diff --git a/include/constants.php b/include/constants.php index d7416b2d..9b7b03c8 100644 --- a/include/constants.php +++ b/include/constants.php @@ -1,6 +1,6 @@