fix: 修复操作日志用户筛选器错误

- 将 relationship 方式改为 options 方式
- 修复 'no such column: activity_log.name' 错误
- 用户筛选器现在可以正常工作
This commit is contained in:
2026-03-09 14:10:38 +08:00
parent 93919956b7
commit 9f411b742a

View File

@@ -170,9 +170,10 @@ class ActivityLogResource extends Resource
// 用户筛选
Tables\Filters\SelectFilter::make('causer_id')
->label('操作用户')
->relationship('causer', 'name')
->options(function () {
return \App\Models\User::pluck('name', 'id')->toArray();
})
->searchable()
->preload()
->placeholder('全部用户'),
// 对象类型筛选