From ba181d6fb3ace7661932c20f370c0c16eb036fa0 Mon Sep 17 00:00:00 2001 From: weigang Date: Wed, 5 Aug 2020 09:11:04 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AF=AD=E9=9F=B3=E6=92=AD=E6=8A=A5=E8=AE=A2?= =?UTF-8?q?=E5=8D=95=E4=B8=8D=E5=AD=98=E5=9C=A8=E6=88=96=E8=AE=BE=E5=A4=87?= =?UTF-8?q?=E5=8F=B7=E4=B8=8D=E5=AD=98=E5=9C=A8=E6=89=93=E5=9B=9E=E6=B6=88?= =?UTF-8?q?=E6=81=AF=E9=98=9F=E5=88=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Amqp/Consumer/DevicOrderConsumer.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/app/Amqp/Consumer/DevicOrderConsumer.php b/app/Amqp/Consumer/DevicOrderConsumer.php index 773f0dd..2bf258a 100644 --- a/app/Amqp/Consumer/DevicOrderConsumer.php +++ b/app/Amqp/Consumer/DevicOrderConsumer.php @@ -35,8 +35,16 @@ class DevicOrderConsumer extends ConsumerMessage ->where(['order_main_id' => $orderMainId, 'type' => 4, 'dm_state' => 2]) ->first(); + if (is_null($order)||!$order) { + return Result::REQUEUE; + } + $deviceName = SpeakerDevic::query()->where(['store_id' => $order['store_id']])->value('device_name'); + if (is_null($deviceName)||!$deviceName) { + return Result::REQUEUE; + } + $msg = "{\"msg\":\"到账".$order['money']."元\"}"; $res = $this->deviceService->pubMsgToStoreByDevName($deviceName, $msg);