fixed
This commit is contained in:
parent
927ab3bc8b
commit
c92d3c7e64
|
@ -26,8 +26,6 @@ class DataCollectController extends BaseApiController
|
||||||
if(!$parmas || !isset($parmas['username']) || $parmas['username']==''){
|
if(!$parmas || !isset($parmas['username']) || $parmas['username']==''){
|
||||||
return $this->fail('参数错误');
|
return $this->fail('参数错误');
|
||||||
}
|
}
|
||||||
$payload= json_decode($parmas['payload'], true);
|
|
||||||
|
|
||||||
$user = User::where('account', $parmas['username'])->find();
|
$user = User::where('account', $parmas['username'])->find();
|
||||||
|
|
||||||
$device = explode('_', $parmas['topic']); // 命名规则:camera_deviceid deviceid为设备主键id
|
$device = explode('_', $parmas['topic']); // 命名规则:camera_deviceid deviceid为设备主键id
|
||||||
|
@ -39,7 +37,7 @@ class DataCollectController extends BaseApiController
|
||||||
|
|
||||||
// mqtt服务端 消息发布事件
|
// mqtt服务端 消息发布事件
|
||||||
if ($parmas['event'] == 'message.publish') {
|
if ($parmas['event'] == 'message.publish') {
|
||||||
|
$payload= json_decode($parmas['payload'], true);
|
||||||
$data = [
|
$data = [
|
||||||
'user_id' => $user['id'],
|
'user_id' => $user['id'],
|
||||||
'land_id' => $landId,
|
'land_id' => $landId,
|
||||||
|
|
Loading…
Reference in New Issue