From a40e2bc74ea61ba1d80073fb3df9ea978acd7411 Mon Sep 17 00:00:00 2001 From: wangxiaowei Date: Mon, 9 Dec 2024 09:48:49 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9C=AC=E5=9C=B0=E7=94=9F=E6=B4=BB=E6=94=B6?= =?UTF-8?q?=E6=AC=BE=E9=87=91=E9=A2=9D=E6=B7=BB=E5=8A=A0=E6=92=AD=E6=8A=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/api/controller/Gtpay.php | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/app/api/controller/Gtpay.php b/app/api/controller/Gtpay.php index de2a5865..cf67b009 100644 --- a/app/api/controller/Gtpay.php +++ b/app/api/controller/Gtpay.php @@ -7,6 +7,8 @@ use app\common\logic\Billions; use app\common\logic\Earnings; use app\common\model\AccountLog; use app\common\model\localstore\LocalGoodsOrder; +use app\common\model\localstore\LocalStoreCloudAudio; +use app\common\server\CloudAudioServer; use app\common\server\JsonServer; use think\facade\Db; class Gtpay extends Api @@ -274,6 +276,8 @@ MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAlu5coHWBbtrz8DyX0VbPWiJZlAsofwZ99pZq // 参与消费返补 $billions = new Billions(); $order['order_amount'] = round($gtpay_msg['txamt']/100,2); + $this->playAudio($post['lid'], $order['order_amount']); + $order['id'] = $gtpay_msg['id']; $order['order_sn'] = $gtpay_msg['orderNo']; $order['type'] = 4; @@ -393,4 +397,23 @@ MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAlu5coHWBbtrz8DyX0VbPWiJZlAsofwZ99pZq $tmpInfo=json_decode($output,true); 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}", + ]); + } } \ No newline at end of file