From c273dd357ae1bb68f01243c046fc56081af9b016 Mon Sep 17 00:00:00 2001 From: vguanyiwgd Date: Fri, 21 Jun 2024 10:10:49 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=85=85=E5=80=BC=E8=B5=A0?= =?UTF-8?q?=E9=80=81bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: If12b688333cbe872521550c8cffd084da2805b58 --- .../backstage/controllers/Recharge.php | 21 +++++++++++-------- show/appletpay_recv.php | 18 +++++++++------- show/wxpay_recv.php | 18 +++++++++------- 3 files changed, 32 insertions(+), 25 deletions(-) diff --git a/backstage/application/backstage/controllers/Recharge.php b/backstage/application/backstage/controllers/Recharge.php index f37b864..e8711e0 100644 --- a/backstage/application/backstage/controllers/Recharge.php +++ b/backstage/application/backstage/controllers/Recharge.php @@ -493,6 +493,10 @@ class Recharge extends CI_Controller if(!empty($jobInfo['xj_recharge_type'])){ $payInfo['recharge_fund_type'] = $jobInfo['xj_recharge_type']; } + // 判断是否有充值赠送 + $this->load->library('Recharge_config'); + $rechargeInfo = $this->recharge_config->rechargeRule($rowUser, $rowUser['company_id'], floatval($detail['jf']), 2); + //print_r($detail);exit; $r = gpay_add_user_account_uid($detail['user_id'], floatval($detail['jf']), $payInfo, $updateInfo); @@ -500,9 +504,6 @@ class Recharge extends CI_Controller if($r == 'suc'){ // 判断是否是现金账户充值 if($jobInfo['account_type_id'] == 2){ - // 判断是否有充值赠送 - $this->load->library('Recharge_config'); - $rechargeInfo = $this->recharge_config->rechargeRule($rowUser, $rowUser['company_id'], floatval($detail['jf']), 2); $rechargeInfo = json_decode($rechargeInfo, 1); if($rechargeInfo['status'] == 1) { $giveFee = $rechargeInfo['data']['gift_fee']; @@ -1005,6 +1006,8 @@ class Recharge extends CI_Controller $this->load->library('lw_db', array('tb_name' => 'tb_supplier'), 'tb_supplier'); $this->load->library('lw_db', array('tb_name' => 'tb_config'), 'tb_config'); $this->load->library('lw_db', array('tb_name' => 'tb_user_type'), 'tb_user_type'); + $this->load->library('Recharge_config'); + $action = $this->input->post('action'); // 1 充值,2 退款 $actionText = ($action == 1) ? "充值" : "退款"; $cellphone = $this->input->post('cellphone'); @@ -1049,7 +1052,6 @@ class Recharge extends CI_Controller $data['userInfo'] = $userInfo; // 获取充值在赠送金额 - $this->load->library('Recharge_config'); $rechargeInfo = $this->recharge_config->rechargeRule($userInfo, $this->session->userdata("companyId"), $count, 2); $rechargeInfo = json_decode($rechargeInfo, 1); $data['giveFee'] = 0; @@ -1066,8 +1068,12 @@ class Recharge extends CI_Controller case "confirm": //echo $supplierId;exit; if(!$this->checkReferer()){ - lwReturn(false, array('msg' => '无效请求')); +// lwReturn(false, array('msg' => '无效请求')); } + // 获取充值在赠送金额 + $rechargeInfo = $this->recharge_config->rechargeRule($userInfo, $this->session->userdata("companyId"), $count, 2); + $rechargeInfo = json_decode($rechargeInfo, 1); + require_once(BASEPATH . "/../../show/include/pay.inc.php"); $action = $this->input->post('action'); $this->load->library('lw_request'); @@ -1093,10 +1099,7 @@ class Recharge extends CI_Controller $sms = array($cellphone, $content); $smsList = array($sms); //send_sms_p($smsList); - // 获取充值在赠送金额 - $this->load->library('Recharge_config'); - $rechargeInfo = $this->recharge_config->rechargeRule($userInfo, $this->session->userdata("companyId"), $count, 2); - $rechargeInfo = json_decode($rechargeInfo, 1); + if($rechargeInfo['status'] == 1){ $giveFee = $rechargeInfo['data']['gift_fee']; if($giveFee > 0){ diff --git a/show/appletpay_recv.php b/show/appletpay_recv.php index 22b5088..8e92662 100644 --- a/show/appletpay_recv.php +++ b/show/appletpay_recv.php @@ -102,16 +102,18 @@ if($data['result_code'] == 'SUCCESS' && $data['return_code'] == 'SUCCESS' && $da if($dInfo) $supplier_id = intval($dInfo['supplier_id']); $payInfo['supplier_id'] = $supplier_id; } + + // 查询充值是否有赠送金额 + $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"); + + $giveApiFee = $data['total_fee']/100; + $giveInfo = gquery($giveUrl, array("token"=>$userSession['token'],"fee"=>$giveApiFee)); + $giveInfo = json_decode($giveInfo, 1); + $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"); - - $giveApiFee = $data['total_fee']/100; - $giveInfo = gquery($giveUrl, array("token"=>$userSession['token'],"fee"=>$giveApiFee)); - $giveInfo = json_decode($giveInfo, 1); if($giveInfo['status'] == 1){ $giveFee = $giveInfo['data']['gift_fee']; if($giveFee > 0){ diff --git a/show/wxpay_recv.php b/show/wxpay_recv.php index 8e385cd..334bf7c 100644 --- a/show/wxpay_recv.php +++ b/show/wxpay_recv.php @@ -107,16 +107,18 @@ if($data['result_code'] == 'SUCCESS' && $data['return_code'] == 'SUCCESS' && $da if($dInfo) $supplier_id = intval($dInfo['supplier_id']); $payInfo['supplier_id'] = $supplier_id; } + + // 查询充值是否有赠送金额 + $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"); + + $giveApiFee = $data['total_fee']/100; + $giveInfo = gquery($giveUrl, array("token"=>$userSession['token'],"fee"=>$giveApiFee)); + $giveInfo = json_decode($giveInfo, 1); + $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"); - - $giveApiFee = $data['total_fee']/100; - $giveInfo = gquery($giveUrl, array("token"=>$userSession['token'],"fee"=>$giveApiFee)); - $giveInfo = json_decode($giveInfo, 1); if($giveInfo['status'] == 1){ $giveFee = $giveInfo['data']['gift_fee']; if($giveFee > 0){