diff --git a/app/api/controller/Gtpay.php b/app/api/controller/Gtpay.php index 0b166f83..9bd880af 100644 --- a/app/api/controller/Gtpay.php +++ b/app/api/controller/Gtpay.php @@ -7,7 +7,9 @@ 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\JsonServer; +use app\common\server\CloudAudioServer; use think\facade\Db; class Gtpay extends Api { @@ -295,6 +297,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; @@ -414,4 +418,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 = empty($sound['message'])? CloudAudioServer::MESSAGE : $sound['message'] ; + CloudAudioServer::send([ + 'id' => $sound['sn'], + 'version' => $sound['version'], + 'message' => "{$message},{$money},元", + ]); + } } \ No newline at end of file