From 1ca17fd9411f1e24307eb0d3ec78251c01bab2cd Mon Sep 17 00:00:00 2001 From: gyhanggd Date: Tue, 2 Apr 2024 11:22:43 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- show/include/pay.inc.php | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/show/include/pay.inc.php b/show/include/pay.inc.php index 985917e..9bd9855 100644 --- a/show/include/pay.inc.php +++ b/show/include/pay.inc.php @@ -265,6 +265,9 @@ function gpay_pay_user_account($uid, $rList, &$updateInfo = '') if (!gpay_lock("account", $uid)) return "lockfail"; $xjList = gpay_get_user_account_list($uid, 2); + if(!$xjList) { //如果没有就取余额为0的 + $xjList = gpay_get_user_account_list($uid, 2, -1, 0, false); + } if($company_id == 54) $jlList = gpay_get_user_account_list($uid, 3); //交通局激励账户 $spList = array(); foreach ($rList as $key => $item) { @@ -279,7 +282,12 @@ function gpay_pay_user_account($uid, $rList, &$updateInfo = '') } if ($supplier_id > 0) { - $spList[$supplier_id] = gpay_get_user_account_list($uid, 1, $supplier_id); + $t1 = gpay_get_user_account_list($uid, 1, $supplier_id); + if(!$t1) { //如果没有就取余额为0的 + $t1 = gpay_get_user_account_list($uid, 1, $supplier_id, 0, false); + } + + $spList[$supplier_id] = $t1; } } @@ -346,8 +354,15 @@ function gpay_pay_user_account($uid, $rList, &$updateInfo = '') }*/ $rechargeList_t = array(); foreach ($yeList as $key => $item2) { - if (round($item2['account'] * 100) <= 0) continue; - if (round($item2['account'] * 100) >= round($ac * 100)) { + $is_zero = false; + if (round($item2['account'] * 100) <= 0) { + if($key == 0 && round($ac * 100) == 0) { //0元消费情况,记录流水 + $is_zero = true; + } else { + continue; + } + } + if ($is_zero || round($item2['account'] * 100) >= round($ac * 100)) { $old_amount = $item2['account']; $recharge_amount = $ac; $yeList[$key]['account'] -= $ac; @@ -396,7 +411,7 @@ function gpay_pay_user_account($uid, $rList, &$updateInfo = '') $rechargeList_t[] = $recInfo; } } - if (round($ac * 100) > 0) { //余额不足 + if (round($ac * 100) > 0 || !$rechargeList_t) { //余额不足 gpay_unlock("account", $uid); return "yebz"; }