This commit is contained in:
weiz 2024-03-06 22:44:03 +08:00
parent 91f0b26f07
commit d1d70966d3
1 changed files with 5 additions and 5 deletions

View File

@ -151,13 +151,13 @@ class FarmController extends BaseApiController
})->select()->toArray();
// 请求mqtt接口
$list = RemoteRequestLogic::getAlarmData($deviceList);
foreach($list as $k=>$v){
$data = RemoteRequestLogic::getAlarmData($deviceList);
foreach($data as $k=>$v){
$time[$k] = strtotime($v['alarm_time']);
}
array_multisort($time, SORT_DESC, $list);
$resultArray = array_slice($list, 0, 7);
return $this->success('成功', compact('resultArray'));
array_multisort($time, SORT_DESC, $data);
$list = array_slice($data, 0, 7);
return $this->success('成功', compact('list'));
}
// 监测设备数量统计