This commit is contained in:
chenbo 2023-12-15 13:51:27 +08:00
parent d9aecf8cea
commit e1f6cd3317
1 changed files with 6 additions and 2 deletions

View File

@ -128,7 +128,7 @@ class LandController extends BaseApiController
$historyList[]['value'] = $valueRow; $historyList[]['value'] = $valueRow;
} }
$list[] = compact('alarmCount', 'historyList'); $list[$type] = compact('alarmCount', 'historyList');
} }
return $this->success('成功', compact('list')); return $this->success('成功', compact('list'));
@ -137,13 +137,17 @@ class LandController extends BaseApiController
// 土地列表 // 土地列表
public function landList() 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 != '') { if ($this->streetCode != '') {
$query->where('l.town_code', $this->streetCode); $query->where('l.town_code', $this->streetCode);
} else { } else {
$query->where('l.county_code', $this->areaCode); $query->where('l.county_code', $this->areaCode);
} }
})->select(); })->select();
return $this->success('成功', compact('list'));
} }
public function centralCount() public function centralCount()