From e1f6cd3317b5ffe63b96c5f09c8ff31afaa8ea5d Mon Sep 17 00:00:00 2001 From: chenbo <709206448@qq.com> Date: Fri, 15 Dec 2023 13:51:27 +0800 Subject: [PATCH] update --- app/api/controller/dataview/LandController.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/app/api/controller/dataview/LandController.php b/app/api/controller/dataview/LandController.php index 3f1bbd27..a18b9b30 100644 --- a/app/api/controller/dataview/LandController.php +++ b/app/api/controller/dataview/LandController.php @@ -128,7 +128,7 @@ class LandController extends BaseApiController $historyList[]['value'] = $valueRow; } - $list[] = compact('alarmCount', 'historyList'); + $list[$type] = compact('alarmCount', 'historyList'); } return $this->success('成功', compact('list')); @@ -137,13 +137,17 @@ class LandController extends BaseApiController // 土地列表 public function landList() { - $list = Land::where(function ($query) { + $list = Land::alias('l')->field('l.*,d.video_url')->join('land_product lp', 'lp.land_id=l.id') + ->join('product_device pd', 'lp.product_id=pd.product_id') + ->join('device d', 'pd.device_id=d.id') + ->where(function ($query) { if ($this->streetCode != '') { $query->where('l.town_code', $this->streetCode); } else { $query->where('l.county_code', $this->areaCode); } })->select(); + return $this->success('成功', compact('list')); } public function centralCount()