From 5788063a9bececd30e7cb0ff1dd0d6ee67f1f876 Mon Sep 17 00:00:00 2001 From: weiz Date: Tue, 28 Nov 2023 10:32:22 +0800 Subject: [PATCH] update --- app/api/controller/IndexController.php | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/app/api/controller/IndexController.php b/app/api/controller/IndexController.php index a8000bac..f1b6d4ff 100644 --- a/app/api/controller/IndexController.php +++ b/app/api/controller/IndexController.php @@ -7,6 +7,7 @@ use app\common\model\land\Land; use app\common\model\land\LandProduct; use app\common\model\monitor\MonitorData; use app\common\model\plant\Plant; +use app\common\model\product\ProductDevice; use think\facade\Log; use think\response\Json; @@ -65,6 +66,12 @@ class IndexController extends BaseApiController 'create_time' => $monitor['create_time'] ]; } + $device = ProductDevice::where('product_id',$landProduct['product_id'])->where('device_type',3)->findOrEmpty(); +// if($device->isEmpty()){ +// $data['monitor']['video_monitor_data'] = ''; +// }else{ +// $data['monitor']['video_monitor_data'] = ''; +// } } return $this->success('请求成功',$data); } @@ -124,13 +131,11 @@ class IndexController extends BaseApiController $plantInfo['land_area'] = $landInfo['total_area']; $plantInfo['land_address'] = $landInfo['province_name'].$landInfo['city_name'].$landInfo['county_name'].$landInfo['town_name'].$landInfo['village_name'].$landInfo['group_name']; //获取操作 - $action = Action::field('type_text,detail,create_time')->where('plant_id',$params['plant_id'])->select()->each(function($item){ + $action = Action::field('type,type_text,detail,create_time')->where('plant_id',$params['plant_id'])->select()->each(function($item){ $item['detail'] = json_decode($item['detail'],true); return $item; })->toArray(); $plantInfo['actions'] = $action; return $this->success('请求成功',$plantInfo->toArray()); } - - } \ No newline at end of file