perf: `支付宝`退款处理: 金额明细已记录数据库

webht/payment
Lei OT 10 months ago
parent 160d6e6621
commit 0c3d3be577

@ -917,7 +917,7 @@ class AlipayTradeService extends CI_Controller
foreach ($biz_detail_table as $key => $row) { foreach ($biz_detail_table as $key => $row) {
$total_amount = 0;$trade_type='';$trade_no = '';$has_charge=null; $total_amount = 0;$trade_type='';$trade_no = '';$has_charge=null;
if (isset($row['finance_id'])) { if (isset($row['finance_id'])) {
if ($row['biz_type'] !== '其它' && $row['biz_type'] !== '在线支付') { if ($row['biz_type'] !== '其它' && $row['biz_type'] !== '在线支付' && $row['biz_type'] !== '转账') {
continue; continue;
} }
$total_amount = floatval($row['income'])>0 ? $row['income'] : $row['expenditure']; $total_amount = floatval($row['income'])>0 ? $row['income'] : $row['expenditure'];

@ -125,9 +125,10 @@ class Alipay_note_model extends CI_Model {
IF NOT EXISTS( IF NOT EXISTS(
SELECT TOP 1 1 SELECT TOP 1 1
FROM AlipayLog FROM AlipayLog
WHERE ALI_dealId = '$ALI_dealId' AND ALI_orderAmount = '$ALI_orderAmount' WHERE ALI_dealId = '$ALI_dealId'
) )
"; ";
// AND ALI_orderAmount = '$ALI_orderAmount'
$sql .= " $sql .= "
INSERT INTO AlipayLog INSERT INTO AlipayLog
( (

@ -1314,6 +1314,7 @@ class Index extends CI_Controller {
$refund_amount = bcsub($payment_memo->mc_gross, $payment_memo->mc_fee); $refund_amount = bcsub($payment_memo->mc_gross, $payment_memo->mc_fee);
$payment_fee = $payment_memo->mc_fee; $payment_fee = $payment_memo->mc_fee;
} }
$refund_amount = bcsub($item->pn_mc_gross, $item->pn_mc_fee);
//添加支付信息入库 //添加支付信息入库
//没有分配订单之前先添加付款记录,这个过程可能会执行多次,必须在添加记录前查找是否有数据 //没有分配订单之前先添加付款记录,这个过程可能会执行多次,必须在添加记录前查找是否有数据

Loading…
Cancel
Save