mirror of
https://github.com/hotspotbilling/phpnuxbill.git
synced 2025-08-02 09:14:34 +02:00
send balance to other users
This commit is contained in:
parent
74ac7f3eb4
commit
a09dc57495
6 changed files with 177 additions and 67 deletions
|
@ -18,15 +18,11 @@ class Balance
|
|||
public static function transfer($id_customer, $phoneTarget, $amount)
|
||||
{
|
||||
global $config;
|
||||
if ($config['allow_balance_transfer'] == 'yes') {
|
||||
if (Balance::min($id_customer, $amount)) {
|
||||
if (Balance::plusByPhone($phoneTarget, $amount)) {
|
||||
return true;
|
||||
} else {
|
||||
Balance::plus($id_customer, $amount);
|
||||
return false;
|
||||
}
|
||||
if (Balance::min($id_customer, $amount)) {
|
||||
if (Balance::plusByPhone($phoneTarget, $amount)) {
|
||||
return true;
|
||||
} else {
|
||||
Balance::plus($id_customer, $amount);
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue