Browse Source

no message

master
weigang 5 years ago
parent
commit
fda6e64c9f
  1. 2
      app/Service/v3/Implementations/DeviceService.php
  2. 2
      app/Service/v3/Implementations/MqttService.php

2
app/Service/v3/Implementations/DeviceService.php

@ -116,7 +116,7 @@ class DeviceService implements DeviceServiceInterface
->where(['store_id' => $order['store_id'], 'is_bind' => SpeakerDevic::IS_BIND_YES]) ->where(['store_id' => $order['store_id'], 'is_bind' => SpeakerDevic::IS_BIND_YES])
->get() ->get()
->toArray(); ->toArray();
$msg = $order['order_main']['type'] == 1 ? "{\"msg\":\"懒族生活提示您:您有新的懒族外卖订单。懒族生活,满足您的美味生活。\"}" : "{\"msg\":\"微信到账".$order['money']."\"}";
$msg = $order['order_main']['type'] == 1 ? "{\"msg\":\"懒族生活提示您:您有新的懒族外卖订单\"}" : "{\"msg\":\"微信到账".$order['money']."\"}";
foreach ($device_names as $key => $dev_name) { foreach ($device_names as $key => $dev_name) {
$this->IOTService->pub($dev_name['device_name'], $msg); $this->IOTService->pub($dev_name['device_name'], $msg);
} }

2
app/Service/v3/Implementations/MqttService.php

@ -31,7 +31,7 @@ class MqttService implements MqttServiceInterface
// 循环发送 // 循环发送
foreach ($orders as $k => &$order) { foreach ($orders as $k => &$order) {
$template = $order->orderMain->type == OrderType::ONLINE ? "懒族生活提示您:您有新的懒族外卖订单。懒族生活,满足您的美味生活。" : "微信到账".floatval($order->money)."";
$template = $order->orderMain->type == OrderType::ONLINE ? "懒族生活提示您:您有新的懒族外卖订单" : "微信到账".floatval($order->money)."";
// 获取终端ID // 获取终端ID
$to_client_id = Store::query()->where(['id' => $order->store_id])->value('loudspeaker_imei'); $to_client_id = Store::query()->where(['id' => $order->store_id])->value('loudspeaker_imei');
// 发布订阅消息 // 发布订阅消息

Loading…
Cancel
Save