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()