From b86efdc00b8c581cad269280f47d7cce868f1ac6 Mon Sep 17 00:00:00 2001 From: Jing Li Date: Fri, 4 Aug 2023 18:27:15 +0800 Subject: [PATCH] Update --- app/Services/LinkosDeviceLogService.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/Services/LinkosDeviceLogService.php b/app/Services/LinkosDeviceLogService.php index 71834c3..5ac1c52 100644 --- a/app/Services/LinkosDeviceLogService.php +++ b/app/Services/LinkosDeviceLogService.php @@ -2,6 +2,7 @@ namespace App\Services; +use App\Enums\DeviceStatus; use App\Enums\DeviceType; use App\Enums\WindDirection; use App\Exceptions\BizException; @@ -89,6 +90,8 @@ class LinkosDeviceLogService throw new BizException("设备未找到, 设备编号: {$deviceId}"); } + Device::where('sn', $deviceId)->update(['status' => DeviceStatus::Online]); + $log = LinkosDeviceLog::create([ 'device_id' => $deviceId, 'device_unit' => $deviceUnit, @@ -235,7 +238,7 @@ class LinkosDeviceLogService } $log->save(); - + } /**