Compare commits
No commits in common. "56f5d9f570d0df2abbd77de759b13aecabe2f7ce" and "96f833c0a49440f5a8e02d8ddb83fe987cb975f5" have entirely different histories.
56f5d9f570
...
96f833c0a4
|
@ -73,8 +73,7 @@ class IndexController extends BaseApiController
|
|||
}
|
||||
|
||||
//视频监控
|
||||
public function video(): Json
|
||||
{
|
||||
public function video() {
|
||||
$params = $this->request->get(['land_id']);
|
||||
if(empty($params['land_id'])){
|
||||
return $this->fail('参数错误');
|
||||
|
@ -85,13 +84,17 @@ class IndexController extends BaseApiController
|
|||
return $this->fail('当前土地未绑定设备产品');
|
||||
}
|
||||
//获取监控设备
|
||||
$productDevice = ProductDevice::where('product_id',$landProduct['product_id'])->where('device_type',3)->column('device_id');
|
||||
if(empty($productDevice)){
|
||||
$productDevice = ProductDevice::where('product_id',$landProduct['product_id'])->where('device_type',3)->findOrEmpty();
|
||||
if($productDevice->isEmpty()){
|
||||
return $this->fail('当前土地未绑定监控设备');
|
||||
}
|
||||
//获取设备编号
|
||||
$device = Device::where('id','in',$productDevice)->select();
|
||||
return $this->success('请求成功',$device->toArray());
|
||||
$device = Device::where('id',$productDevice['device_id'])->findOrEmpty();
|
||||
if($device->isEmpty()){
|
||||
return $this->fail('监控设备信息错误');
|
||||
}
|
||||
//获取监控数据
|
||||
//todo
|
||||
}
|
||||
|
||||
// 获取短信验证码
|
||||
|
|
|
@ -181,7 +181,6 @@
|
|||
]);
|
||||
Device::where('id','in',$productDevice)->update([
|
||||
'user_id' => $land['user_id'],
|
||||
'is_bind' => 2,
|
||||
'update_time' => time()
|
||||
]);
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue