調整 API 包帳 排序
This commit is contained in:
parent
79cf1b920b
commit
f3eaa9c715
@ -67,7 +67,9 @@ class BranchControlController extends Controller
|
||||
*/
|
||||
public function Branches(Request $request): JsonResponse
|
||||
{
|
||||
$branches = Branch::with('rooms')->orderBy('name', 'asc')->get()->map(function ($branch) {
|
||||
$branches = Branch::with(['rooms' => function ($query) {
|
||||
$query->orderBy('name', 'asc'); // 對 rooms 的 name 排序
|
||||
}])->get()->map(function ($branch) {
|
||||
return [
|
||||
'id' => $branch->id,
|
||||
'branch_name' => $branch->name,
|
||||
|
Loading…
x
Reference in New Issue
Block a user