加入 Room 用 name 排序 20250724

This commit is contained in:
allen.yan 2025-07-24 11:54:13 +08:00
parent 630aab8109
commit 042b56d62f
2 changed files with 2 additions and 2 deletions

View File

@ -31,7 +31,7 @@ class RoomGridForm extends Component
$floors = []; $floors = [];
if ($branch) { if ($branch) {
$rooms = Room::where('branch_id', $branch->id)->get(); $rooms = Room::where('branch_id', $branch->id)->orderBy('name', 'asc')->get();
$floors = $rooms->pluck('floor')->unique()->sort()->values()->toArray(); $floors = $rooms->pluck('floor')->unique()->sort()->values()->toArray();
} }

View File

@ -74,7 +74,7 @@ final class RoomTable extends PowerGridComponent
public function datasource(): Builder public function datasource(): Builder
{ {
return Room::query(); return Room::query()->orderBy('name', 'asc');
} }
public function relationSearch(): array public function relationSearch(): array