This commit is contained in:
weiz 2023-10-31 17:36:52 +08:00
parent 77c5c35bbc
commit 1603adda7c
1 changed files with 3 additions and 0 deletions

View File

@ -251,6 +251,9 @@
$item['create_time'] = date('m-d',$item['create_time']); $item['create_time'] = date('m-d',$item['create_time']);
return $item; return $item;
})->toArray(); })->toArray();
if(empty($data)){
return $this->fail('暂无数据');
}
$result = [ $result = [
['soil_temp' => array_column($data,'soil_temp'),'create_time' => array_column($data,'create_time'),'max'=>max(array_column($data,'soil_temp'))], ['soil_temp' => array_column($data,'soil_temp'),'create_time' => array_column($data,'create_time'),'max'=>max(array_column($data,'soil_temp'))],
['soil_mois' => array_column($data,'soil_mois'),'create_time' => array_column($data,'create_time'),'max'=>max(array_column($data,'soil_mois'))], ['soil_mois' => array_column($data,'soil_mois'),'create_time' => array_column($data,'create_time'),'max'=>max(array_column($data,'soil_mois'))],