app 和 小程序 都增加充值赠送

Change-Id: I83cbaa88f7caa76d2fb6804ea3950821295c0d93
This commit is contained in:
vguanyiwgd 2024-06-06 15:30:18 +08:00
parent 98c62ea546
commit 36ad601ead
2 changed files with 48 additions and 2 deletions

View File

@ -103,6 +103,29 @@ 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);

View File

@ -108,6 +108,29 @@ 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);