From 77c5c35bbcace31c6fe4cebb01097677325f5877 Mon Sep 17 00:00:00 2001 From: weiz Date: Tue, 31 Oct 2023 17:16:43 +0800 Subject: [PATCH] update --- app/api/controller/LandPlantController.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/app/api/controller/LandPlantController.php b/app/api/controller/LandPlantController.php index b2d8df29..f7644156 100644 --- a/app/api/controller/LandPlantController.php +++ b/app/api/controller/LandPlantController.php @@ -252,11 +252,11 @@ return $item; })->toArray(); $result = [ - ['soil_temp' => array_column($data,'soil_temp'),'create_time' => array_column($data,'create_time')], - ['soil_mois' => array_column($data,'soil_mois'),'create_time' => array_column($data,'create_time')], - ['p_content' => array_column($data,'p_content'),'create_time' => array_column($data,'create_time')], - ['n_content' => array_column($data,'n_content'),'create_time' => array_column($data,'create_time')], - ['k_content' => array_column($data,'k_content'),'create_time' => array_column($data,'create_time')], + ['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'))], + ['p_content' => array_column($data,'p_content'),'create_time' => array_column($data,'create_time'),'max'=>max(array_column($data,'p_content'))], + ['n_content' => array_column($data,'n_content'),'create_time' => array_column($data,'create_time'),'max'=>max(array_column($data,'n_content'))], + ['k_content' => array_column($data,'k_content'),'create_time' => array_column($data,'create_time'),'max'=>max(array_column($data,'k_content'))], ]; return $this->success('请求成功',$result); }