update 设备断开后更新设备表的设备在线状态

This commit is contained in:
chenbo 2023-12-14 15:05:07 +08:00
parent 8571666ad5
commit d318614d48
1 changed files with 3 additions and 0 deletions

View File

@ -1,6 +1,7 @@
<?php
namespace app\api\controller;
use app\common\model\device\Device;
use app\common\model\device\DeviceOffline;
use app\common\model\device\MonitorAlarm;
use app\common\model\device\MonitorThreshold;
@ -182,6 +183,8 @@ class DataCollectController extends BaseApiController
'update_time' => time()
];
DeviceOffline::create($addData);
Device::where('id', $item['device_id'])->update(['is_online' => 2]);
}
return $this->success('接收成功');
}