dev
Jing Li 2023-08-04 18:27:15 +08:00
parent c2475f4baa
commit b86efdc00b
1 changed files with 4 additions and 1 deletions

View File

@ -2,6 +2,7 @@
namespace App\Services; namespace App\Services;
use App\Enums\DeviceStatus;
use App\Enums\DeviceType; use App\Enums\DeviceType;
use App\Enums\WindDirection; use App\Enums\WindDirection;
use App\Exceptions\BizException; use App\Exceptions\BizException;
@ -89,6 +90,8 @@ class LinkosDeviceLogService
throw new BizException("设备未找到, 设备编号: {$deviceId}"); throw new BizException("设备未找到, 设备编号: {$deviceId}");
} }
Device::where('sn', $deviceId)->update(['status' => DeviceStatus::Online]);
$log = LinkosDeviceLog::create([ $log = LinkosDeviceLog::create([
'device_id' => $deviceId, 'device_id' => $deviceId,
'device_unit' => $deviceUnit, 'device_unit' => $deviceUnit,