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(); - + } /**