send balance to other users

This commit is contained in:
Ibnu Maksum
2023-08-23 16:46:05 +07:00
parent 74ac7f3eb4
commit a09dc57495
6 changed files with 177 additions and 67 deletions

View File

@ -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 {