This commit is contained in:
parent
6fb1f17d58
commit
1ca17fd941
|
@ -265,6 +265,9 @@ function gpay_pay_user_account($uid, $rList, &$updateInfo = '')
|
||||||
if (!gpay_lock("account", $uid)) return "lockfail";
|
if (!gpay_lock("account", $uid)) return "lockfail";
|
||||||
|
|
||||||
$xjList = gpay_get_user_account_list($uid, 2);
|
$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); //交通局激励账户
|
if($company_id == 54) $jlList = gpay_get_user_account_list($uid, 3); //交通局激励账户
|
||||||
$spList = array();
|
$spList = array();
|
||||||
foreach ($rList as $key => $item) {
|
foreach ($rList as $key => $item) {
|
||||||
|
@ -279,7 +282,12 @@ function gpay_pay_user_account($uid, $rList, &$updateInfo = '')
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($supplier_id > 0) {
|
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();
|
$rechargeList_t = array();
|
||||||
foreach ($yeList as $key => $item2) {
|
foreach ($yeList as $key => $item2) {
|
||||||
if (round($item2['account'] * 100) <= 0) continue;
|
$is_zero = false;
|
||||||
if (round($item2['account'] * 100) >= round($ac * 100)) {
|
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'];
|
$old_amount = $item2['account'];
|
||||||
$recharge_amount = $ac;
|
$recharge_amount = $ac;
|
||||||
$yeList[$key]['account'] -= $ac;
|
$yeList[$key]['account'] -= $ac;
|
||||||
|
@ -396,7 +411,7 @@ function gpay_pay_user_account($uid, $rList, &$updateInfo = '')
|
||||||
$rechargeList_t[] = $recInfo;
|
$rechargeList_t[] = $recInfo;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (round($ac * 100) > 0) { //余额不足
|
if (round($ac * 100) > 0 || !$rechargeList_t) { //余额不足
|
||||||
gpay_unlock("account", $uid);
|
gpay_unlock("account", $uid);
|
||||||
return "yebz";
|
return "yebz";
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue