本地生活收款金额添加播报

This commit is contained in:
wangxiaowei 2024-12-09 09:48:49 +08:00
parent 209cc825ec
commit a40e2bc74e

@ -7,6 +7,8 @@ use app\common\logic\Billions;
use app\common\logic\Earnings; use app\common\logic\Earnings;
use app\common\model\AccountLog; use app\common\model\AccountLog;
use app\common\model\localstore\LocalGoodsOrder; use app\common\model\localstore\LocalGoodsOrder;
use app\common\model\localstore\LocalStoreCloudAudio;
use app\common\server\CloudAudioServer;
use app\common\server\JsonServer; use app\common\server\JsonServer;
use think\facade\Db; use think\facade\Db;
class Gtpay extends Api class Gtpay extends Api
@ -274,6 +276,8 @@ MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAlu5coHWBbtrz8DyX0VbPWiJZlAsofwZ99pZq
// 参与消费返补 // 参与消费返补
$billions = new Billions(); $billions = new Billions();
$order['order_amount'] = round($gtpay_msg['txamt']/100,2); $order['order_amount'] = round($gtpay_msg['txamt']/100,2);
$this->playAudio($post['lid'], $order['order_amount']);
$order['id'] = $gtpay_msg['id']; $order['id'] = $gtpay_msg['id'];
$order['order_sn'] = $gtpay_msg['orderNo']; $order['order_sn'] = $gtpay_msg['orderNo'];
$order['type'] = 4; $order['type'] = 4;
@ -393,4 +397,23 @@ MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAlu5coHWBbtrz8DyX0VbPWiJZlAsofwZ99pZq
$tmpInfo=json_decode($output,true); $tmpInfo=json_decode($output,true);
return $tmpInfo; return $tmpInfo;
} }
private function playAudio($lstore_id, $money) {
if (!$lstore_id && !$money) {
return;
}
$sound = LocalStoreCloudAudio::where('lstore_id', $lstore_id)->field('sn, version, message')->find();
if (!$sound) {
return;
}
$message = $sound['message'] ?? CloudAudioServer::MESSAGE;
CloudAudioServer::send([
'id' => $sound['sn'],
'version' => $sound['version'],
'message' => "{$message},{$money}",
]);
}
} }