溯源操作
This commit is contained in:
parent
a0d6fa73b4
commit
a9730932e8
|
@ -42,6 +42,9 @@ class IndexController extends BaseApiController
|
||||||
return $this->success('请求成功',[]);
|
return $this->success('请求成功',[]);
|
||||||
}
|
}
|
||||||
$product = Product::where('fence_house_id', $data['id'])->findOrEmpty()->toArray();
|
$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');
|
$deviceIds = ProductDevice::where('product_id', $product['id'])->column('device_id');
|
||||||
$device = Device::whereIn('id', $deviceIds)->where('type', 2)->findOrEmpty();
|
$device = Device::whereIn('id', $deviceIds)->where('type', 2)->findOrEmpty();
|
||||||
$data['video_url'] = $device['video_url'];
|
$data['video_url'] = $device['video_url'];
|
||||||
|
|
Loading…
Reference in New Issue