From a9730932e839052290830fee745afc4d8bc45078 Mon Sep 17 00:00:00 2001 From: chenbo <709206448@qq.com> Date: Mon, 29 Jan 2024 09:25:59 +0800 Subject: [PATCH] =?UTF-8?q?=E6=BA=AF=E6=BA=90=E6=93=8D=E4=BD=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/api/controller/IndexController.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/api/controller/IndexController.php b/app/api/controller/IndexController.php index c1b8616..1118c6d 100644 --- a/app/api/controller/IndexController.php +++ b/app/api/controller/IndexController.php @@ -42,6 +42,9 @@ class IndexController extends BaseApiController return $this->success('请求成功',[]); } $product = Product::where('fence_house_id', $data['id'])->findOrEmpty()->toArray(); + if(empty($product)){ + return $this->fail('栏舍暂未绑定产品',[]); + } $deviceIds = ProductDevice::where('product_id', $product['id'])->column('device_id'); $device = Device::whereIn('id', $deviceIds)->where('type', 2)->findOrEmpty(); $data['video_url'] = $device['video_url'];