Update
parent
644b37da28
commit
fe42931606
|
|
@ -137,14 +137,14 @@ class DeviceLogSyncCommand extends Command
|
||||||
case DeviceType::InsectSexLure:
|
case DeviceType::InsectSexLure:
|
||||||
$data = $httpClient->getWormPhotos($device->sn, $now->copy()->subHours(24), $now);
|
$data = $httpClient->getWormPhotos($device->sn, $now->copy()->subHours(24), $now);
|
||||||
|
|
||||||
foreach ($data['imgUrl'] as $item) {
|
// foreach ($data['imgUrl'] as $item) {
|
||||||
WormPhoto::firstOrCreate([
|
// WormPhoto::firstOrCreate([
|
||||||
'device_id' => $device->id,
|
// 'device_id' => $device->id,
|
||||||
'uploaded_at' => $item['time'],
|
// 'uploaded_at' => $item['time'],
|
||||||
], [
|
// ], [
|
||||||
'url' => $item['url'],
|
// 'url' => $item['url'],
|
||||||
]);
|
// ]);
|
||||||
}
|
// }
|
||||||
|
|
||||||
$device->update([
|
$device->update([
|
||||||
'status' => count($data['imgUrl'] ?? []) > 0 ? DeviceStatus::Online : DeviceStatus::Offline,
|
'status' => count($data['imgUrl'] ?? []) > 0 ? DeviceStatus::Online : DeviceStatus::Offline,
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue