From c92d3c7e6431580becc9286c5c3b23c86f4376aa Mon Sep 17 00:00:00 2001 From: chenbo <709206448@qq.com> Date: Thu, 22 Feb 2024 16:11:34 +0800 Subject: [PATCH] fixed --- app/api/controller/DataCollectController.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/app/api/controller/DataCollectController.php b/app/api/controller/DataCollectController.php index 556a6937..3c84ebdc 100644 --- a/app/api/controller/DataCollectController.php +++ b/app/api/controller/DataCollectController.php @@ -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,