From 36ad601eada3edaf4f13815267810d7f59bbd709 Mon Sep 17 00:00:00 2001 From: vguanyiwgd Date: Thu, 6 Jun 2024 15:30:18 +0800 Subject: [PATCH] =?UTF-8?q?app=20=E5=92=8C=20=E5=B0=8F=E7=A8=8B=E5=BA=8F?= =?UTF-8?q?=20=E9=83=BD=E5=A2=9E=E5=8A=A0=E5=85=85=E5=80=BC=E8=B5=A0?= =?UTF-8?q?=E9=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I83cbaa88f7caa76d2fb6804ea3950821295c0d93 --- show/appletpay_recv.php | 25 ++++++++++++++++++++++++- show/wxpay_recv.php | 25 ++++++++++++++++++++++++- 2 files changed, 48 insertions(+), 2 deletions(-) diff --git a/show/appletpay_recv.php b/show/appletpay_recv.php index 5becb5f..59f96d3 100644 --- a/show/appletpay_recv.php +++ b/show/appletpay_recv.php @@ -103,7 +103,30 @@ if($data['result_code'] == 'SUCCESS' && $data['return_code'] == 'SUCCESS' && $da $payInfo['supplier_id'] = $supplier_id; } $rs = gpay_add_user_account_uid($orderInfo['uid'], $orderInfo['total_fee'], $payInfo); - + if($rs == 'suc'){ + // 查询充值是否有赠送金额 + $giveUrl = "https://yzms.fsecity.com/api/recharge/get_give_fee"; + // 获取用户token + $userSession = $db->get_one("select * from tb_session where uid = ".$orderInfo['uid'] . " order by expire_time desc"); + $giveInfo = gquery($giveUrl, array("token"=>$userSession['token'],"fee"=>$data['total_fee'])); + $giveInfo = json_decode($giveInfo, 1); + if($giveInfo['status'] == 1){ + $giveFee = $giveInfo['data']['gift_fee']; + if($giveFee > 0){ + $rechargePayInfo = array( + 'admin_id' => 1, + 'rtype' => 1, + 'ac_type' => 1, + 'notes' => '充值赠送', + ); + if(isset($supplier_id) && !empty($supplier_id)){ + $rechargePayInfo['supplier_id'] = $supplier_id; + } + $r = gpay_add_user_account_uid($orderInfo['uid'], floatval($giveFee), $rechargePayInfo); + } + } + } + $db->query("update tb_recharge_pay_weixin set state=1,suctime=now(),transaction_id='".$data['transaction_id']."' where id=".$orderInfo['id']); //file_put_contents("1.txt", $_SERVER["HTTP_USER_AGENT"].": ".$UPTRANSEQ."\n\n\n", FILE_APPEND); if(!$wxrecv_isinclude) { diff --git a/show/wxpay_recv.php b/show/wxpay_recv.php index ed759dd..71e5a25 100644 --- a/show/wxpay_recv.php +++ b/show/wxpay_recv.php @@ -108,7 +108,30 @@ if($data['result_code'] == 'SUCCESS' && $data['return_code'] == 'SUCCESS' && $da $payInfo['supplier_id'] = $supplier_id; } $rs = gpay_add_user_account_uid($orderInfo['uid'], $orderInfo['total_fee'], $payInfo); - + if($rs == 'suc'){ + // 查询充值是否有赠送金额 + $giveUrl = "https://yzms.fsecity.com/api/recharge/get_give_fee"; + // 获取用户token + $userSession = $db->get_one("select * from tb_session where uid = ".$orderInfo['uid'] . " order by expire_time desc"); + $giveInfo = gquery($giveUrl, array("token"=>$userSession['token'],"fee"=>$data['total_fee'])); + $giveInfo = json_decode($giveInfo, 1); + if($giveInfo['status'] == 1){ + $giveFee = $giveInfo['data']['gift_fee']; + if($giveFee > 0){ + $rechargePayInfo = array( + 'admin_id' => 1, + 'rtype' => 1, + 'ac_type' => 1, + 'notes' => '充值赠送', + ); + if(isset($supplier_id) && !empty($supplier_id)){ + $rechargePayInfo['supplier_id'] = $supplier_id; + } + $r = gpay_add_user_account_uid($orderInfo['uid'], floatval($giveFee), $rechargePayInfo); + } + } + } + $db->query("update tb_recharge_pay_weixin set state=1,suctime=now(),transaction_id='".$data['transaction_id']."' where id=".$orderInfo['id']); //file_put_contents("1.txt", $_SERVER["HTTP_USER_AGENT"].": ".$UPTRANSEQ."\n\n\n", FILE_APPEND); if(!$wxrecv_isinclude) {