+ 10 mesi fa
parent
commit
3b28c3568f

+ 1 - 1
application/admin/services/MqttMessageClient.php

@@ -29,7 +29,7 @@ class MqttMessageClient
         $password = Env::get("mqtt.password");
 
 
-        $mqtt = new \PhpMqtt\Client\MqttClient($hostname, $port, $clientId, MqttClient::MQTT_3_1_1);
+        $mqtt = new MqttClient($hostname, $port, $clientId, MqttClient::MQTT_3_1_1);
         $connectionSettings = (new ConnectionSettings());
         if ($username !== null) {
             $connectionSettings = $connectionSettings->setUsername($username);

+ 1 - 2
application/jobs/DeviceReportEvent.php

@@ -47,11 +47,10 @@ class DeviceReportEvent
 
     protected function online($device_id, $data)
     {
-        $device = Device::where("device_sn", $device_id)->get();
+        $device = Device::where("device_sn", $device_id)->find();
         if (!$device) {
             return false;
         }
-
         $device->status = 1;
         $device->save();
     }

+ 1 - 1
composer.json

@@ -19,8 +19,8 @@
         "topthink/framework": "dev-master",
         "topthink/think-captcha": "^1.0",
         "topthink/think-installer": "^1.0.14",
-        "topthink/think-queue": "^3.0",
         "topthink/think-helper": "^1.0.7",
+        "topthink/think-queue": "^2.0",
         "karsonzhang/fastadmin-addons": "~1.3.2",
         "overtrue/pinyin": "^3.0",
         "phpoffice/phpspreadsheet": "1.19",