This commit is contained in:
chenbo 2024-02-22 16:11:34 +08:00
parent 927ab3bc8b
commit c92d3c7e64
1 changed files with 1 additions and 3 deletions

View File

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