調整 room 用 name 排序 20250724
This commit is contained in:
parent
0c7ad9070c
commit
79cf1b920b
@ -67,7 +67,7 @@ class BranchControlController extends Controller
|
|||||||
*/
|
*/
|
||||||
public function Branches(Request $request): JsonResponse
|
public function Branches(Request $request): JsonResponse
|
||||||
{
|
{
|
||||||
$branches = Branch::with('rooms')->get()->map(function ($branch) {
|
$branches = Branch::with('rooms')->orderBy('name', 'asc')->get()->map(function ($branch) {
|
||||||
return [
|
return [
|
||||||
'id' => $branch->id,
|
'id' => $branch->id,
|
||||||
'branch_name' => $branch->name,
|
'branch_name' => $branch->name,
|
||||||
|
@ -38,7 +38,7 @@ class RoomGrid extends Component
|
|||||||
|
|
||||||
public function render()
|
public function render()
|
||||||
{
|
{
|
||||||
$rooms = Room::where('branch_id', $this->branch_id)->get();
|
$rooms = Room::where('branch_id', $this->branch_id)->orderBy('name', 'asc')->get();
|
||||||
// 取得樓層
|
// 取得樓層
|
||||||
$floors = $rooms->pluck('floor')->unique()->sort()->values()->toArray();
|
$floors = $rooms->pluck('floor')->unique()->sort()->values()->toArray();
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user