add
This commit is contained in:
parent
51e80acad3
commit
fa932f41dd
|
@ -43,7 +43,7 @@ class IndexController extends BaseApiController
|
||||||
}
|
}
|
||||||
$product = Product::where('fence_house_id', $data['id'])->findOrEmpty()->toArray();
|
$product = Product::where('fence_house_id', $data['id'])->findOrEmpty()->toArray();
|
||||||
if(empty($product)){
|
if(empty($product)){
|
||||||
return $this->fail('栏舍暂未绑定产品',[]);
|
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();
|
||||||
|
|
Loading…
Reference in New Issue