This commit is contained in:
weiz 2023-11-03 10:05:32 +08:00
parent ea642ce971
commit 20f2a74c20
2 changed files with 21 additions and 21 deletions

View File

@ -297,11 +297,11 @@
return $this->fail('暂无数据');
}
$result = [
['soil_temp' => '土地温度','categories' => array_column($data,'create_time'),'series'=>['name'=>'目标值','data'=>array_column($data,'soil_temp')],'max'=>max(array_column($data,'soil_temp'))],
['soil_mois' => '土地湿度','categories' => array_column($data,'create_time'),'series'=>['name'=>'目标值','data'=>array_column($data,'soil_mois')],'max'=>max(array_column($data,'soil_mois'))],
['p_content' => '土壤磷含量','categories' => array_column($data,'create_time'),'series'=>['name'=>'目标值','data'=>array_column($data,'p_content')],'max'=>max(array_column($data,'p_content'))],
['n_content' => '土壤氮含量','categories' => array_column($data,'create_time'),'series'=>['name'=>'目标值','data'=>array_column($data,'n_content')],'max'=>max(array_column($data,'n_content'))],
['k_content' => '土壤钾含量','categories' => array_column($data,'create_time'),'series'=>['name'=>'目标值','data'=>array_column($data,'k_content')],'max'=>max(array_column($data,'k_content'))],
['soil_temp' => '土地温度','categories' => array_column($data,'create_time'),'series'=>[['name'=>'目标值','data'=>array_column($data,'soil_temp')]],'max'=>max(array_column($data,'soil_temp'))],
['soil_mois' => '土地湿度','categories' => array_column($data,'create_time'),'series'=>[['name'=>'目标值','data'=>array_column($data,'soil_mois')]],'max'=>max(array_column($data,'soil_mois'))],
['p_content' => '土壤磷含量','categories' => array_column($data,'create_time'),'series'=>[['name'=>'目标值','data'=>array_column($data,'p_content')]],'max'=>max(array_column($data,'p_content'))],
['n_content' => '土壤氮含量','categories' => array_column($data,'create_time'),'series'=>[['name'=>'目标值','data'=>array_column($data,'n_content')]],'max'=>max(array_column($data,'n_content'))],
['k_content' => '土壤钾含量','categories' => array_column($data,'create_time'),'series'=>[['name'=>'目标值','data'=>array_column($data,'k_content')]],'max'=>max(array_column($data,'k_content'))],
];
return $this->success('请求成功',$result);
}

View File

@ -98,11 +98,11 @@
return $this->fail('暂无数据');
}
$result = [
['soil_temp' => '土地温度','categories' => array_column($data,'create_time'),'series'=>['name'=>'目标值','data'=>array_column($data,'soil_temp')],'max'=>max(array_column($data,'soil_temp'))],
['soil_mois' => '土地湿度','categories' => array_column($data,'create_time'),'series'=>['name'=>'目标值','data'=>array_column($data,'soil_mois')],'max'=>max(array_column($data,'soil_mois'))],
['p_content' => '土壤磷含量','categories' => array_column($data,'create_time'),'series'=>['name'=>'目标值','data'=>array_column($data,'p_content')],'max'=>max(array_column($data,'p_content'))],
['n_content' => '土壤氮含量','categories' => array_column($data,'create_time'),'series'=>['name'=>'目标值','data'=>array_column($data,'n_content')],'max'=>max(array_column($data,'n_content'))],
['k_content' => '土壤钾含量','categories' => array_column($data,'create_time'),'series'=>['name'=>'目标值','data'=>array_column($data,'k_content')],'max'=>max(array_column($data,'k_content'))],
['soil_temp' => '土地温度','categories' => array_column($data,'create_time'),'series'=>[['name'=>'目标值','data'=>array_column($data,'soil_temp')]],'max'=>max(array_column($data,'soil_temp'))],
['soil_mois' => '土地湿度','categories' => array_column($data,'create_time'),'series'=>[['name'=>'目标值','data'=>array_column($data,'soil_mois')]],'max'=>max(array_column($data,'soil_mois'))],
['p_content' => '土壤磷含量','categories' => array_column($data,'create_time'),'series'=>[['name'=>'目标值','data'=>array_column($data,'p_content')]],'max'=>max(array_column($data,'p_content'))],
['n_content' => '土壤氮含量','categories' => array_column($data,'create_time'),'series'=>[['name'=>'目标值','data'=>array_column($data,'n_content')]],'max'=>max(array_column($data,'n_content'))],
['k_content' => '土壤钾含量','categories' => array_column($data,'create_time'),'series'=>[['name'=>'目标值','data'=>array_column($data,'k_content')]],'max'=>max(array_column($data,'k_content'))],
];
break;
case 2:
@ -115,12 +115,12 @@
return $this->fail('暂无数据');
}
$result = [
['hj_temp' => '环境温度','categories' => array_column($data,'create_time'),'series'=>['name'=>'目标值','data'=>array_column($data,'hj_temp')],'max'=>max(array_column($data,'hj_temp'))],
['hj_humi' => '环境湿度','categories' => array_column($data,'create_time'),'series'=>['name'=>'目标值','data'=>array_column($data,'hj_humi')],'max'=>max(array_column($data,'hj_humi'))],
['o_content' => '氧气浓度','categories' => array_column($data,'create_time'),'series'=>['name'=>'目标值','data'=>array_column($data,'o_content')],'max'=>max(array_column($data,'o_content'))],
['c_content' => '二氧化碳浓度','categories' => array_column($data,'create_time'),'series'=>['name'=>'目标值','data'=>array_column($data,'c_content')],'max'=>max(array_column($data,'c_content'))],
['light' => '光照强调','categories' => array_column($data,'create_time'),'series'=>['name'=>'目标值','data'=>array_column($data,'light')],'max'=>max(array_column($data,'light'))],
['dqy' => '大气压强','categories' => array_column($data,'create_time'),'series'=>['name'=>'目标值','data'=>array_column($data,'dqy')],'max'=>max(array_column($data,'dqy'))],
['hj_temp' => '环境温度','categories' => array_column($data,'create_time'),'series'=>[['name'=>'目标值','data'=>array_column($data,'hj_temp')]],'max'=>max(array_column($data,'hj_temp'))],
['hj_humi' => '环境湿度','categories' => array_column($data,'create_time'),'series'=>[['name'=>'目标值','data'=>array_column($data,'hj_humi')]],'max'=>max(array_column($data,'hj_humi'))],
['o_content' => '氧气浓度','categories' => array_column($data,'create_time'),'series'=>[['name'=>'目标值','data'=>array_column($data,'o_content')]],'max'=>max(array_column($data,'o_content'))],
['c_content' => '二氧化碳浓度','categories' => array_column($data,'create_time'),'series'=>[['name'=>'目标值','data'=>array_column($data,'c_content')]],'max'=>max(array_column($data,'c_content'))],
['light' => '光照强调','categories' => array_column($data,'create_time'),'series'=>[['name'=>'目标值','data'=>array_column($data,'light')]],'max'=>max(array_column($data,'light'))],
['dqy' => '大气压强','categories' => array_column($data,'create_time'),'series'=>[['name'=>'目标值','data'=>array_column($data,'dqy')]],'max'=>max(array_column($data,'dqy'))],
];
break;
case 3:
@ -133,11 +133,11 @@
return $this->fail('暂无数据');
}
$result = [
['water_temp' => '水温','categories' => array_column($data,'create_time'),'series'=>['name'=>'目标值','data'=>array_column($data,'water_temp')],'max'=>max(array_column($data,'water_temp'))],
['ph_content' => '酸碱度','categories' => array_column($data,'create_time'),'series'=>['name'=>'目标值','data'=>array_column($data,'ph_content')],'max'=>max(array_column($data,'ph_content'))],
['dissolved_oxygen' => '溶解氧','categories' => array_column($data,'create_time'),'series'=>['name'=>'目标值','data'=>array_column($data,'dissolved_oxygen')],'max'=>max(array_column($data,'dissolved_oxygen'))],
['electric_conductivity' => '电导率','categories' => array_column($data,'create_time'),'series'=>['name'=>'目标值','data'=>array_column($data,'electric_conductivity')],'max'=>max(array_column($data,'electric_conductivity'))],
['tds' => 'TDS','categories' => array_column($data,'create_time'),'series'=>['name'=>'目标值','data'=>array_column($data,'tds')],'max'=>max(array_column($data,'tds'))],
['water_temp' => '水温','categories' => array_column($data,'create_time'),'series'=>[['name'=>'目标值','data'=>array_column($data,'water_temp')]],'max'=>max(array_column($data,'water_temp'))],
['ph_content' => '酸碱度','categories' => array_column($data,'create_time'),'series'=>[['name'=>'目标值','data'=>array_column($data,'ph_content')]],'max'=>max(array_column($data,'ph_content'))],
['dissolved_oxygen' => '溶解氧','categories' => array_column($data,'create_time'),'series'=>[['name'=>'目标值','data'=>array_column($data,'dissolved_oxygen')]],'max'=>max(array_column($data,'dissolved_oxygen'))],
['electric_conductivity' => '电导率','categories' => array_column($data,'create_time'),'series'=>[['name'=>'目标值','data'=>array_column($data,'electric_conductivity')]],'max'=>max(array_column($data,'electric_conductivity'))],
['tds' => 'TDS','categories' => array_column($data,'create_time'),'series'=>[['name'=>'目标值','data'=>array_column($data,'tds')]],'max'=>max(array_column($data,'tds'))],
];
break;
default: