From 78772d86a50a0b67e97908238264350ea906fd6e Mon Sep 17 00:00:00 2001 From: "allen.yan" Date: Tue, 3 Jun 2025 17:45:10 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8A=A0=E5=85=A5=20=E6=94=B6=E4=B8=AD?= =?UTF-8?q?=E6=8E=A7=20=E5=9B=9E=E5=82=B3=E6=8E=A7=E5=88=B6=E7=8B=80?= =?UTF-8?q?=E6=85=8B=2020250603?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .DS_Store | Bin 10244 -> 10244 bytes .../Controllers/RoomControlController.php | 24 ++++++++++++++++++ routes/console.php | 2 +- 開發手冊.ini | 2 +- 4 files changed, 26 insertions(+), 2 deletions(-) diff --git a/.DS_Store b/.DS_Store index 2f7ce99ad3536cb5cc3718bcadde5f06263e29ee..0c178c171186d01f5e33e686baf70af8ff905cd1 100644 GIT binary patch delta 21 ccmZn(XbIS`S%AaT$UsNI$i#Bvalidated(); + $branch = Branch::where('name',$validated['branch_name'])->first(); + $room = Room::where([ + ['branch_id', $branch->id], + ['name', $validated['room_name']], + ])->first(); + + if (!$branch) { + return ApiResponse::error('分店不存在'); + } + + if (!$room) { + return ApiResponse::error('房間不存在'); + } + + $room->status=$validated['command']; + $room->started_at=$validated['started_at']; + $room->ended_at=$validated['ended_at']; + $room->save(); + + return ApiResponse::success($room); + } } diff --git a/routes/console.php b/routes/console.php index 7757724..d597c15 100644 --- a/routes/console.php +++ b/routes/console.php @@ -9,7 +9,7 @@ Artisan::command('inspire', function () { })->purpose('Display an inspiring quote'); -Schedule::command('machine_statuses:clear')->dailyAt('12:00'); // 每天凌晨 12:10 執行 +Schedule::command('app:clear-machine-statuses')->dailyAt('12:00'); // 每天凌晨 12:10 執行 //首次部署或有新增命令時)建立或更新任務排程 Crontab // 檢查是否已有下列 crontab 設定(crontab -e): //分鐘 小時 日 月 星期 指令 diff --git a/開發手冊.ini b/開發手冊.ini index 4be6a6d..0a10598 100644 --- a/開發手冊.ini +++ b/開發手冊.ini @@ -146,4 +146,4 @@ IP 1F;svr01,svr02 1F;pc101,pc102,pc103,pc104,pc105,pc106,pc108 2F;pc201,pc202,pc203,pc205 -9F;pc901,pc902,pc903 \ No newline at end of file +9F;pc901,pc902,pc903,pc910 \ No newline at end of file