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,