This commit is contained in:
gyhanggd 2024-04-02 11:22:43 +08:00
parent 6fb1f17d58
commit 1ca17fd941
1 changed files with 19 additions and 4 deletions

View File

@ -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";
}