Browse Source

修改语音播报内容

master
weigang 5 years ago
parent
commit
963da8e8d5
  1. 2
      app/Service/DeviceServiceImp.php
  2. 2
      app/Service/MqttSpeakerService.php

2
app/Service/DeviceServiceImp.php

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

2
app/Service/MqttSpeakerService.php

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

Loading…
Cancel
Save