update 设备断开后更新设备表的设备在线状态
This commit is contained in:
parent
8571666ad5
commit
d318614d48
|
@ -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('接收成功');
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue